Implement dual target-close paths and residual option expiry.
Document and enforce: A full dual-leg close, B perp-only when deep OTM with residual archive that does not block next open, and expiry settlement when target is missed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -166,6 +166,14 @@ export type PlanState = {
|
||||
initial_premium?: number;
|
||||
premium_gap?: number;
|
||||
};
|
||||
residuals?: {
|
||||
group_id: string;
|
||||
option_inst_id: string;
|
||||
option_side: string;
|
||||
strike: number | null;
|
||||
expiry_ymd: string | null;
|
||||
status: string;
|
||||
}[];
|
||||
ledger: { equity: number; available: number; reserved: number };
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
const STATUS_ZH: Record<string, string> = {
|
||||
open: "持仓中",
|
||||
closed: "已平仓",
|
||||
option_residual: "期权残留待到期",
|
||||
};
|
||||
|
||||
const SIDE_ZH: Record<string, string> = {
|
||||
@@ -23,9 +24,10 @@ const ACTION_ZH: Record<string, string> = {
|
||||
};
|
||||
|
||||
const CLOSE_REASON_ZH: Record<string, string> = {
|
||||
fixed_usdt: "固定净盈利达标",
|
||||
premium_multiple: "权利金倍数达标",
|
||||
expiry: "到期自动全平",
|
||||
fixed_usdt: "固定净盈利达标·双腿全平",
|
||||
premium_multiple: "权利金倍数达标·双腿全平",
|
||||
target_perp_only: "净盈利达标·只平永续(期权归档)",
|
||||
expiry: "到期结算",
|
||||
emergency: "紧急全平",
|
||||
manual: "手动平仓",
|
||||
liquidity_retry: "流动性等待后续平仓",
|
||||
|
||||
@@ -134,7 +134,8 @@ export default function PlanPage() {
|
||||
<p style={{ color: "var(--muted)", marginTop: -8 }}>
|
||||
SIM 本地撮合 · 行情{" "}
|
||||
{(snap?.exchange || "okx").toUpperCase()}
|
||||
{snap?.perp_inst_id ? ` · ${snap.perp_inst_id}` : ""} · 净盈利达标或到期全平
|
||||
{snap?.perp_inst_id ? ` · ${snap.perp_inst_id}` : ""} ·
|
||||
目标平仓(双腿/远虚只平永续) · 未达标则到期结算
|
||||
</p>
|
||||
{err ? <div className="err">{err}</div> : null}
|
||||
|
||||
@@ -228,6 +229,19 @@ export default function PlanPage() {
|
||||
<span>当前组</span>
|
||||
<span className="mono">{pos?.group_id || "—"}</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>残留期权(待到期)</span>
|
||||
<span className="mono">
|
||||
{plan?.residuals && plan.residuals.length > 0
|
||||
? plan.residuals
|
||||
.map(
|
||||
(r) =>
|
||||
`${r.group_id}:${r.option_inst_id || "?"}@${r.expiry_ymd || "?"}`
|
||||
)
|
||||
.join(" · ")
|
||||
: "无"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>信号方向</span>
|
||||
<span className="mono">{biasTag}</span>
|
||||
|
||||
Reference in New Issue
Block a user