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}`;
|
const riskOrOpen = `${lossPct || "—"}/${openRatio}`;
|
||||||
return {
|
return {
|
||||||
riskBased,
|
riskBased,
|
||||||
sizing: riskBased ? "以损定仓" : "手动仓位",
|
sizing: riskBased ? "以损定仓(A)" : "手动开仓(B)",
|
||||||
sizingShort: riskBased ? "以损" : "手动",
|
sizingShort: riskBased ? "A" : "B",
|
||||||
lossPct,
|
lossPct,
|
||||||
exit,
|
exit,
|
||||||
openRatio,
|
openRatio,
|
||||||
@@ -234,9 +234,17 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
|||||||
function modeLabel(mode: string, strat: Record<string, unknown>): string {
|
function modeLabel(mode: string, strat: Record<string, unknown>): string {
|
||||||
const m = String(mode || "-").toUpperCase();
|
const m = String(mode || "-").toUpperCase();
|
||||||
const short = m.includes("LIVE") ? "LIVE" : m.includes("SIM") ? "SIM" : m || "-";
|
const short = m.includes("LIVE") ? "LIVE" : m.includes("SIM") ? "SIM" : m || "-";
|
||||||
|
// A=以损定仓,B=手动开仓
|
||||||
return `${short}/${riskLines(strat).sizingShort}`;
|
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: {
|
function tokenDotClass(n: {
|
||||||
token_configured?: boolean;
|
token_configured?: boolean;
|
||||||
fleet_ok?: boolean | null;
|
fleet_ok?: boolean | null;
|
||||||
@@ -768,7 +776,12 @@ export default function MonitorPage() {
|
|||||||
<td>
|
<td>
|
||||||
<strong className="machine-name">{n.name}</strong>
|
<strong className="machine-name">{n.name}</strong>
|
||||||
</td>
|
</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="mono">{s.exchange}</td>
|
||||||
<td className={inPos ? "pnl-pos" : "pnl-neg"}>
|
<td className={inPos ? "pnl-pos" : "pnl-neg"}>
|
||||||
{inPos ? "持仓中" : "无持仓"}
|
{inPos ? "持仓中" : "无持仓"}
|
||||||
|
|||||||
Reference in New Issue
Block a user