Show min option hours in control risk/open column.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -271,6 +271,9 @@ async def fleet_status(_tok: Annotated[str, Depends(require_fleet_token)]) -> di
|
|||||||
"min_option_leverage": _pick(
|
"min_option_leverage": _pick(
|
||||||
"min_option_leverage", float(settings.min_option_leverage)
|
"min_option_leverage", float(settings.min_option_leverage)
|
||||||
),
|
),
|
||||||
|
"min_option_hours": _pick(
|
||||||
|
"min_option_hours", float(settings.min_option_hours)
|
||||||
|
),
|
||||||
"perp_margin_mode": st.get("perp_margin_mode"),
|
"perp_margin_mode": st.get("perp_margin_mode"),
|
||||||
"perp_qty_eth": st.get("perp_qty_eth"),
|
"perp_qty_eth": st.get("perp_qty_eth"),
|
||||||
"option_qty_eth": st.get("option_qty_eth"),
|
"option_qty_eth": st.get("option_qty_eth"),
|
||||||
|
|||||||
@@ -180,8 +180,9 @@ type RiskLines = {
|
|||||||
lossPct: string | null;
|
lossPct: string | null;
|
||||||
exit: string;
|
exit: string;
|
||||||
openRatio: string | null;
|
openRatio: string | null;
|
||||||
/** 表格「风险/开仓」列:如 5%/1:2;手动为 —/名义比 */
|
/** 表格「风险/开仓」列:如 5%/1:2/12;手动为 —/名义比/时长 */
|
||||||
riskOrOpen: string;
|
riskOrOpen: string;
|
||||||
|
minHours: string;
|
||||||
leverage: string;
|
leverage: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -218,7 +219,9 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
|||||||
const openRatio = riskBased
|
const openRatio = riskBased
|
||||||
? `${unitLabel(strat.risk_perp_unit)}:${unitLabel(strat.risk_option_unit)}`
|
? `${unitLabel(strat.risk_perp_unit)}:${unitLabel(strat.risk_option_unit)}`
|
||||||
: `${unitLabel(strat.perp_qty_eth)}:${unitLabel(strat.option_qty_eth)}`;
|
: `${unitLabel(strat.perp_qty_eth)}:${unitLabel(strat.option_qty_eth)}`;
|
||||||
const riskOrOpen = `${lossPct || "—"}/${openRatio}`;
|
const hoursN = Number(strat.min_option_hours);
|
||||||
|
const minHours = Number.isFinite(hoursN) ? unitLabel(hoursN) : "—";
|
||||||
|
const riskOrOpen = `${lossPct || "—"}/${openRatio}/${minHours}`;
|
||||||
return {
|
return {
|
||||||
riskBased,
|
riskBased,
|
||||||
sizing: riskBased ? "以损定仓(A)" : "手动开仓(B)",
|
sizing: riskBased ? "以损定仓(A)" : "手动开仓(B)",
|
||||||
@@ -227,6 +230,7 @@ function riskLines(strat: Record<string, unknown>): RiskLines {
|
|||||||
exit,
|
exit,
|
||||||
openRatio,
|
openRatio,
|
||||||
riskOrOpen,
|
riskOrOpen,
|
||||||
|
minHours,
|
||||||
leverage: leveragePair(strat),
|
leverage: leveragePair(strat),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -789,7 +793,7 @@ export default function MonitorPage() {
|
|||||||
<td className="mono">{s.rounds ?? "—"}</td>
|
<td className="mono">{s.rounds ?? "—"}</td>
|
||||||
<td
|
<td
|
||||||
className="mono"
|
className="mono"
|
||||||
title="风险比例 / 开仓比例"
|
title="风险比例 / 开仓比例 / 最小剩余时长(h)"
|
||||||
>
|
>
|
||||||
{risk.riskOrOpen}
|
{risk.riskOrOpen}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user