Gate opens when ATM-spot offset exceeds configurable max (default 3).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -197,7 +197,8 @@ export default function PlanPage() {
|
||||
<span>选约条件</span>
|
||||
<span className="mono">
|
||||
剩余≥{fmt(plan?.min_option_hours, 0)}h · 期权杠杆≥
|
||||
{fmt(plan?.min_option_leverage, 0)}x
|
||||
{fmt(plan?.min_option_leverage, 0)}x · ATM偏差≤
|
||||
{fmt(plan?.max_atm_open_offset ?? 3, 0)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
@@ -415,9 +416,11 @@ export default function PlanPage() {
|
||||
? (snap.perp.bid + snap.perp.ask) / 2
|
||||
: null);
|
||||
if (strike == null || px == null) return "—";
|
||||
const d = strike - px;
|
||||
const sign = d > 0 ? "+" : "";
|
||||
return `${sign}${d.toFixed(0)}(最近可用行权价)`;
|
||||
const abs = Math.abs(strike - px);
|
||||
const sign = strike - px > 0 ? "+" : "";
|
||||
const lim = plan?.max_atm_open_offset ?? 3;
|
||||
const ok = abs <= lim + 1e-9;
|
||||
return `${sign}${(strike - px).toFixed(0)} · 开仓${ok ? "可" : "不可"}(|Δ|≤${lim})`;
|
||||
})()}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,7 @@ export default function SettingsPage() {
|
||||
const [leverage, setLeverage] = useState(3);
|
||||
const [minHours, setMinHours] = useState(12);
|
||||
const [minOptLev, setMinOptLev] = useState(100);
|
||||
const [maxAtmOff, setMaxAtmOff] = useState(3);
|
||||
const [closeDevPct, setCloseDevPct] = useState(30);
|
||||
const [perpQty, setPerpQty] = useState(1);
|
||||
const [optQty, setOptQty] = useState(2);
|
||||
@@ -50,6 +51,7 @@ export default function SettingsPage() {
|
||||
setLeverage(s.leverage ?? 3);
|
||||
setMinHours(s.min_option_hours ?? 12);
|
||||
setMinOptLev(s.min_option_leverage ?? 100);
|
||||
setMaxAtmOff(s.max_atm_open_offset ?? 3);
|
||||
setCloseDevPct(s.close_bid_mark_max_pct ?? 30);
|
||||
setPerpQty(s.perp_qty_eth ?? 1);
|
||||
setOptQty(s.option_qty_eth ?? 2);
|
||||
@@ -107,6 +109,7 @@ export default function SettingsPage() {
|
||||
leverage,
|
||||
min_option_hours: minHours,
|
||||
min_option_leverage: minOptLev,
|
||||
max_atm_open_offset: maxAtmOff,
|
||||
close_bid_mark_max_pct: closeDevPct,
|
||||
perp_qty_eth: perpQty,
|
||||
option_qty_eth: optQty,
|
||||
@@ -257,6 +260,21 @@ export default function SettingsPage() {
|
||||
onChange={(e) => setMinOptLev(Number(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="atmoff">开仓 ATM 最大偏差(点)</label>
|
||||
<input
|
||||
id="atmoff"
|
||||
className="mono"
|
||||
type="number"
|
||||
step="0.5"
|
||||
min="0"
|
||||
value={maxAtmOff}
|
||||
onChange={(e) => setMaxAtmOff(Number(e.target.value))}
|
||||
/>
|
||||
<p className="settings-hint">
|
||||
|ATM 行权价 − 标的价| 超过该值则不开仓。默认 3;币安行权价步进较粗时可能长时间无开仓机会。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user