feat: add timed position close (1h/2h/4h) for key levels and live orders

Program monitors open positions and market-closes at deadline; UI shows label and countdown on instance and hub boards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-11 19:30:16 +08:00
parent 879ea5e228
commit 959593cdab
17 changed files with 1152 additions and 69 deletions
+9
View File
@@ -2304,6 +2304,15 @@
meta.push(
`<span class="${beOn ? "pos-meta-on" : "pos-meta-off"}">移动保本:${beOn ? "开" : "关"}</span>`
);
if (mo.time_close_enabled) {
const tcLabel = mo.time_close_label || `时间平仓 ${mo.time_close_hours || ""}h`;
const tcCd = mo.time_close_countdown || "--:--:--";
const tcAt = mo.time_close_at_ms != null ? String(mo.time_close_at_ms) : "";
meta.push(
`<span class="pos-meta-item pos-meta-on pos-time-close-meta" data-close-at-ms="${esc(tcAt)}">` +
`${esc(tcLabel)} · 倒计时 <span class="pos-time-close-cd">${esc(tcCd)}</span></span>`
);
}
} else {
meta.push("来源: 交易所持仓");
meta.push("风格: —");