dekun
8d67f3fc6c
Fix LIVE SoT P0/P1: closing state machine, OO exchange fills, BN balances.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 15:54:45 +08:00
dekun
99e58910d3
Treat exchange as LIVE SoT: expiry closes perp only, no invented option settles.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 15:44:15 +08:00
dekun
4f56eff40c
Anchor semi exit to strike +/- move points; side-by-side semi cards.
...
Forward target is K+/-N not spot+/-N; UI shows option target and perp net lock.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:59:48 +08:00
dekun
5ea54db43b
Let semi-auto reopen nearest expiry; ignore one-expiry-per-day.
...
Far quarterly skips were masking usable near OTM quotes like 260810.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:48:07 +08:00
dekun
f1e3d5527a
Fix semi open stalls: one-leg asks, OTM realign, clearer pick errors.
...
Monitor no longer shows ATM Put bias while semi-auto is authorized for Call.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:43:00 +08:00
dekun
b09d1b0886
Show semi risk-based open size from ask and unit ratio.
...
Semi sizing uses market ask with semi units; Plan panel previews option/perp qty under the form.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 14:27:19 +08:00
dekun
457838ef64
Extend semi-auto with ITM/ATM/OTM, offset, and 1:4 sizing.
...
Moneyness and perp:option units are plan-only; OTM enforces leverage >=180.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 11:42:57 +08:00
dekun
4585dba3c3
Add 永期半自动: human arm, machine open/close, then stop.
...
Settings toggle, Plan panel, Fleet monitor, exit locks and armed TOCTOU gates; docs and dual audits.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-08 11:20:11 +08:00
dekun
bf3441537e
Fix target-exit mismatch: correct close reason and executable PnL gate.
...
Locked premium exits no longer label as fixed_usdt; mark/book optimism no longer triggers close into a realized loss.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 22:05:34 +08:00
dekun
a88d708ea3
Add amplitude filter as first open gate for 永期 hedge.
...
Reuse OO amplitude settings (default off); Plan shows index/HL when filtering.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 21:41:51 +08:00
dekun
b377956367
Fix false USDC-short error while waiting for a qualified option.
...
Use risk-sizing preview ask/qty (same as auto-convert) instead of monitor book ask.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 19:28:58 +08:00
dekun
ab612df818
Move settings hints into rules; add OO amplitude filter toggle default off.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 17:58:50 +08:00
dekun
0daac05ef5
Reject OO strikes more than 1% from amplitude high/low.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 17:50:12 +08:00
dekun
24a860ad3f
Split OO budget per leg and size Call/Put independently.
...
Each half of the risk budget buys its own qty from ask; equal qty no longer forced.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 17:08:05 +08:00
dekun
8d3c181246
Hide perp signal direction in option-option mode.
...
Plan panel shows Call+Put structure and OO selection/exit labels instead.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 16:18:40 +08:00
dekun
ec244c63c6
Add option-option hedge mode with SIM/LIVE parity.
...
Mutual hedge_mode, amplitude OTM selection, 1:1 risk sizing, win-leg/full close, dual audits and docs.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 16:01:16 +08:00
dekun
0f552eb50e
Add martingale mode for risk-based percent sizing.
...
Enable in settings (default off): after N consecutive loss days, double the effective risk_loss_pct up to a configurable max; blocked when base pct > 3%.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-07 09:55:29 +08:00
dekun
1252f45aac
Add strategy residual table with manual close at panel bottom.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-03 07:47:22 +08:00
dekun
a10ecf7409
Gate one-open-per-expiry by historical expiry_ymd across days.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-03 07:35:44 +08:00
dekun
469e7a258a
Harden residual mid-close: IOC partial fills, exchange reconcile, atomic book.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-02 14:41:00 +08:00
dekun
62c91d4bd0
Close residual options when premium recovers above configurable threshold.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-02 14:19:21 +08:00
dekun
0e3b9e53ac
Enrich WeCom open/close notifies with Chinese qty, margin, and PnL.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-02 08:58:49 +08:00
dekun
f1da2778ef
Add one-expiry-per-day open rhythm gate (default on).
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-01 16:39:32 +08:00
dekun
67f22626e9
Show risk params box on control cards and modal.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 14:58:30 +08:00
dekun
200702d066
Harden strategy SoT: fail-closed funds gate, shared open pipeline, LIVE switch guards.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 01:06:32 +08:00
dekun
cc0f0ffd0d
Run OKX auto USDC convert before option pick when trading USDC is short.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 00:28:11 +08:00
dekun
0837982714
Add OKX trading-account USDC auto-swap and lock exit target while in position.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-30 00:16:47 +08:00
dekun
5eb169a636
Show live risk-sizing estimate on plan page instead of stale manual qty.
...
When 以损定仓 is on, state() overlays next-open k/qty/exit from market preview.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 23:52:43 +08:00
dekun
a47a9b6377
Polish risk sizing: 2dp money preview, editable ratio/exit, plan badge.
...
Exit unit and perp/option units scale with k; plan page shows 以损定仓.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 23:48:34 +08:00
dekun
3a4c8d639c
Add risk-based position sizing (以损定仓) with per-open k resize.
...
Manual vs risk modes are exclusive; each open floors k to 1 decimal so estimated premium+fees stay within the loss budget.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 23:32:42 +08:00
dekun
101cb3c045
Fix ghost finalize on unknown perp size and open rollback hazards.
...
Distinguish exchange query None from flat zero; keep opening when size unknown; idempotent half_open cash; scan options while opening; continue manage after recover.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 20:47:29 +08:00
dekun
e2a19a1614
Recover stuck opening and harden LIVE open/close reconcile.
...
Stamp open intent, recover opening from exchange option/perp state, skip resell/reopen when already flat, and persist Binance margin mode.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 20:32:45 +08:00
dekun
44fd0371b9
Fix OKX abandon residual double-book and fill/residual ledger holes.
...
After dual-close leaves option pending, continue close_group instead of false residual; reject partial fills on wait timeout; LIVE residual settle allow_negative.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 20:20:36 +08:00
dekun
c6e8f6fe1e
Support LIVE exchange funds and perp margin mode.
...
Hide sim equity when LIVE is selected; OKX funds bar uses exchange balances; add cross/isolated for perp only (options stay cash).
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 19:57:09 +08:00
dekun
0ee1d8be5d
Add fixed-direction switch for perp/option open side.
...
When enabled, lock perp long→buy Put or short→buy Call with ITM/ATM only; off keeps ATM/ask rules.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 19:18:12 +08:00
dekun
55109e82d3
Hide SIM label in WeCom; count completed rounds from closed groups.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 18:15:09 +08:00
dekun
71b5fcae79
Show strategy rules in fold; larger nav; notify only when cannot open.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 18:12:26 +08:00
dekun
a5945f0837
Notify funds short once; check trading only; drop duplicate plan title.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 18:07:59 +08:00
dekun
80c561bdce
Show open-capacity labels, enlarge funds, move rules; WeCom on short funds.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 17:53:43 +08:00
dekun
5c3bd4b654
Add OKX-style funds bar with USDT/USDC convert and transfer.
...
SIM uses multi-wallet balances; LIVE hits OKX asset/account APIs and spot USDC-USDT swap. Funds strip hides sim labeling.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-29 17:06:13 +08:00
dekun
56a4007130
Add WeCom markdown alerts and keep target exits while strategy is paused.
...
Notify open/close/start/pause/fault with SIM vs LIVE venue labels; configure webhook in Settings.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 23:19:39 +08:00
dekun
9d3b36826c
Include LIVE close-fee estimate in target PnL; rest after manual and emergency close.
...
Align docs so LIVE exit matches SIM fee buffer; manual full close now enters rest_seconds like auto/emergency.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 22:58:10 +08:00
dekun
16efa44ffb
Hide manual trade by default, block open while running, auto-refresh auth token.
...
Also fix flat-side reconcile to check both long and short residuals; document in 更新说明.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 22:43:38 +08:00
dekun
0cf3756b09
Harden LIVE opens with slot claim and exchange reconcile.
...
Prevent duplicate opens by atomically claiming an opening slot, verifying exchange perp is flat before live orders, setting leverage from ledger, and preferring exchange position size when closing perps.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 22:39:27 +08:00
dekun
dbc86a1ce6
Add Binance live trading, anti-stuck open/close recovery, and configurable rate limits.
...
OKX/Binance LIVE share half_open and option_closed_perp_pending repair paths; private REST throttles default to 1s and are tunable in settings.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 21:35:10 +08:00
dekun
e666230d0b
Add SIM/LIVE switch with API keys saved to .env and OKX live executor.
...
Enable settings UI for mode/keys, gate strategy start when LIVE is not ready, and stop PM2 from forcing MODE=SIM.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-26 21:08:39 +08:00
dekun
4994aaab16
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 >
2026-07-26 18:32:05 +08:00
dekun
21ca5cbfe0
Survive Binance eapi 418/429 with cooldown, soft start, and no ticker raise.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-25 12:49:14 +08:00
dekun
fff285c1f9
Add ATM open-offset toggle default off.
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-25 12:42:20 +08:00
dekun
ee0ec57f89
Gate opens when ATM-spot offset exceeds configurable max (default 3).
...
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-25 12:32:36 +08:00