Add ATM open-offset toggle default off.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-25 12:42:20 +08:00
parent 79c074ec6c
commit fff285c1f9
12 changed files with 93 additions and 24 deletions
+9 -3
View File
@@ -197,8 +197,10 @@ export default function PlanPage() {
<span></span>
<span className="mono">
{fmt(plan?.min_option_hours, 0)}h ·
{fmt(plan?.min_option_leverage, 0)}x · ATM偏差
{fmt(plan?.max_atm_open_offset ?? 3, 0)}
{fmt(plan?.min_option_leverage, 0)}x
{plan?.atm_open_offset_enabled
? ` · ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: " · ATM偏差关"}
</span>
</div>
<div className="kv">
@@ -418,9 +420,13 @@ export default function PlanPage() {
if (strike == null || px == null) return "—";
const abs = Math.abs(strike - px);
const sign = strike - px > 0 ? "+" : "";
const delta = `${sign}${(strike - px).toFixed(0)}`;
if (!plan?.atm_open_offset_enabled) {
return `${delta} · 偏差限制关`;
}
const lim = plan?.max_atm_open_offset ?? 3;
const ok = abs <= lim + 1e-9;
return `${sign}${(strike - px).toFixed(0)} · 开仓${ok ? "可" : "不可"}(|Δ|≤${lim})`;
return `${delta} · 开仓${ok ? "可" : "不可"}(|Δ|≤${lim})`;
})()}
</span>
</div>