Show control monitor mode as SIM/A or SIM/B sizing codes.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -221,8 +221,8 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
||||
const riskOrOpen = `${lossPct || "—"}/${openRatio}`;
|
||||
return {
|
||||
riskBased,
|
||||
sizing: riskBased ? "以损定仓" : "手动仓位",
|
||||
sizingShort: riskBased ? "以损" : "手动",
|
||||
sizing: riskBased ? "以损定仓(A)" : "手动开仓(B)",
|
||||
sizingShort: riskBased ? "A" : "B",
|
||||
lossPct,
|
||||
exit,
|
||||
openRatio,
|
||||
@@ -234,9 +234,17 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
||||
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}`;
|
||||
}
|
||||
|
||||
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=手动开仓"})`;
|
||||
}
|
||||
|
||||
function tokenDotClass(n: {
|
||||
token_configured?: boolean;
|
||||
fleet_ok?: boolean | null;
|
||||
@@ -768,7 +776,12 @@ export default function MonitorPage() {
|
||||
<td>
|
||||
<strong className="machine-name">{n.name}</strong>
|
||||
</td>
|
||||
<td className="mono">{modeLabel(s.mode, s.strat)}</td>
|
||||
<td
|
||||
className="mono"
|
||||
title={modeLabelTitle(s.mode, s.strat)}
|
||||
>
|
||||
{modeLabel(s.mode, s.strat)}
|
||||
</td>
|
||||
<td className="mono">{s.exchange}</td>
|
||||
<td className={inPos ? "pnl-pos" : "pnl-neg"}>
|
||||
{inPos ? "持仓中" : "无持仓"}
|
||||
|
||||
Reference in New Issue
Block a user