Add dual exit modes: fixed USDT or premium multiple.
Net PnL (after estimated close fees) drives auto close; Plan/Settings expose the choice. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -75,15 +75,20 @@ export default function PlanPage() {
|
||||
|
||||
const pos = plan?.position;
|
||||
const open = !!pos?.has_position;
|
||||
const exitPct = plan?.exit_move_pct ?? 2;
|
||||
const movePct = pos?.move_pct ?? 0;
|
||||
const exitMode = plan?.exit_mode ?? "fixed_usdt";
|
||||
const exitTarget = plan?.exit_target_usdt ?? plan?.net_profit_target ?? 15;
|
||||
const netPnl = pos?.net_pnl ?? 0;
|
||||
const exitRuleLabel =
|
||||
exitMode === "premium_multiple"
|
||||
? `权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
|
||||
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
|
||||
const phaseLabel = PHASE_ZH[plan?.phase || ""] || plan?.phase || "—";
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2 style={{ marginTop: 0 }}>自动对冲计划</h2>
|
||||
<p style={{ color: "var(--muted)", marginTop: -8 }}>
|
||||
SIM 本地撮合 · 期权只买 · 剩余时长选到期 · 波动按比例全平
|
||||
SIM 本地撮合 · 期权只买 · 剩余时长选到期 · 净盈利达标全平
|
||||
</p>
|
||||
{err ? <div className="err">{err}</div> : null}
|
||||
|
||||
@@ -174,17 +179,25 @@ export default function PlanPage() {
|
||||
<span className="mono">{biasTag}</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>永续浮盈 / 距覆盖</span>
|
||||
<span>出场规则</span>
|
||||
<span className="mono">{exitRuleLabel}</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>净盈利 / 目标</span>
|
||||
<span className="mono">
|
||||
<span className={pnlClass(pos?.perp_upl)}>{fmt(pos?.perp_upl)}</span>
|
||||
<span className={pnlClass(open ? netPnl : null)}>
|
||||
{open ? fmt(netPnl) : "—"}
|
||||
</span>
|
||||
{" / "}
|
||||
{fmt(pos?.premium_gap)}
|
||||
{open || exitMode === "fixed_usdt" ? fmt(exitTarget) : "—"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>波动进度</span>
|
||||
<span>永续浮盈 / 期权浮盈</span>
|
||||
<span className="mono">
|
||||
{fmt(movePct, 2)}% / {fmt(exitPct, 2)}%
|
||||
<span className={pnlClass(pos?.perp_upl)}>{fmt(pos?.perp_upl)}</span>
|
||||
{" / "}
|
||||
<span className={pnlClass(pos?.option_upl)}>{fmt(pos?.option_upl)}</span>
|
||||
</span>
|
||||
</div>
|
||||
{plan?.last_error ? (
|
||||
|
||||
Reference in New Issue
Block a user