Show 永期/期期 in control monitor mode column.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -235,18 +235,27 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
||||
};
|
||||
}
|
||||
|
||||
function hedgeModeShort(strat: Record<string, unknown>): string {
|
||||
const hm = String(strat.hedge_mode || "perp_option")
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
return hm === "option_option" ? "期期" : "永期";
|
||||
}
|
||||
|
||||
function modeLabel(mode: string, strat: Record<string, unknown>): string {
|
||||
const m = String(mode || "-").toUpperCase();
|
||||
const short = m.includes("LIVE") ? "LIVE" : m.includes("SIM") ? "SIM" : m || "-";
|
||||
// A=以损定仓,B=手动开仓
|
||||
return `${short}/${riskLines(strat).sizingShort}`;
|
||||
// A=以损定仓,B=手动开仓;永期=永续+期权,期期=双期权
|
||||
return `${short}/${riskLines(strat).sizingShort}/${hedgeModeShort(strat)}`;
|
||||
}
|
||||
|
||||
function modeLabelTitle(mode: string, strat: Record<string, unknown>): string {
|
||||
const label = modeLabel(mode, strat);
|
||||
const riskBased =
|
||||
strat.sizing_mode === "risk_based" || strat.risk_based === true;
|
||||
return `${label}(${riskBased ? "A=以损定仓" : "B=手动开仓"})`;
|
||||
const hedge =
|
||||
hedgeModeShort(strat) === "期期" ? "期期=双期权对冲" : "永期=永续+期权";
|
||||
return `${label}(${riskBased ? "A=以损定仓" : "B=手动开仓"};${hedge})`;
|
||||
}
|
||||
|
||||
function tokenDotClass(n: {
|
||||
@@ -983,7 +992,8 @@ export default function MonitorPage() {
|
||||
{detailRunning ? "运行中" : "已停"} · {detail.phase}
|
||||
</td>
|
||||
<td>
|
||||
{detail.mode} / {detail.exchange}
|
||||
{modeLabel(detail.mode, detail.strat)} /{" "}
|
||||
{detail.exchange}
|
||||
</td>
|
||||
<td>{detail.rounds ?? "—"}</td>
|
||||
<td className="mono">
|
||||
|
||||
Reference in New Issue
Block a user