Commit Graph

227 Commits

Author SHA1 Message Date
dekun 3a20546782 Make risk policy and settings panels full width.
Match the funds header span by spanning the two-column content grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:55:40 +08:00
dekun 35117ba84e Polish dashboard tables: hub-style orders, options source/expiry, hedge status.
Show 进行中 in green for active hedges; options columns include source/target/expiry; merge live mark/contracts/pnl from price snapshot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:23:25 +08:00
dekun cd2dfac2ba Hide empty dashboard sections and render data as tables.
Orders/keys/strategy/options/hedge only appear when they have rows, shown in table layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:14:03 +08:00
dekun c7aae67881 Add instance data dashboard (default off).
Read-only overview of live orders, key monitors, and strategy; show options/hedge only when present. Toggle via system settings nav prefs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:09:29 +08:00
dekun f7ba7c2f7d Auto-fill journal direction from trade records.
Add a required direction field on the review form, persist it, and set long/short when clicking 填入复盘.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 12:00:09 +08:00
dekun f435e9dfaa Render saved journals as a table like trade records.
Desktop journal list now uses columns for coin, direction, PnL, times, and actions instead of stacked entry cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 11:55:18 +08:00
dekun d9b8069906 Add shared records review pagination for all three exchanges.
Paginate trade records, journals, and AI history at 5 per page with soft in-card flips; hide the journal form until 填入复盘.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 11:52:02 +08:00
dekun 57f8d6761c Keep options review paging in-card without layout jump.
Soft-load table rows on prev/next so height stays stable and the page below does not flash.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 11:40:23 +08:00
dekun 77ab7503a1 Show total pages and card-local AJAX paging on options review.
Trades and reviewed lists now report page X / Y and flip without full-page sync refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 11:34:21 +08:00
dekun 8842f0b869 Restructure options review into pending trades, form, and reviewed detail.
Show five pending trades per page, reveal the upload form only after clicking 复盘, and list saved reviews with image detail above stats.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 10:50:12 +08:00
dekun 01ca035c2a Add typed options review form presets by source.
Pure options and hedge plans use separate strategy/entry selects, with auto-filled direction and PnL result including breakeven.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 10:27:23 +08:00
dekun d7272c9722 Persist options review deletes across local resync.
Hide deleted rows by history key and contract/close fingerprint so local options_trades imports no longer resurrect them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 10:03:00 +08:00
dekun 48afc8ebe3 Load options review from local records with compact journal UI.
Drop exchange sync for the review page, auto-import closed local options and hedge plans, and match contract-style multi-timeframe upload styling with smaller fonts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 09:54:35 +08:00
dekun c6142dc246 Show options review upload form always on page.
Keep the multi-timeframe journal card visible like contract review instead of hiding it until a row is selected.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 09:49:14 +08:00
dekun edcc04e88c Improve options review tabs and multi-timeframe uploads.
Add source-type tabs, open an inline journal form from list rows, and match contract-style 5m/15m/1h/4h screenshot slots.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 09:45:44 +08:00
dekun 10128d18bc Add OKX options review module with hedge plan entries.
Import closed OKX option history and closed hedge plans into one list for journaling, images, and stats without mixing contract reviews.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 09:35:19 +08:00
dekun eb5c6a658b Show hedge targets in control center
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 07:29:45 +08:00
dekun 8f71dbe874 Show hedge targets in options monitoring
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 07:15:00 +08:00
dekun 6e6cb7caac Add active hedge plan tab
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 07:04:51 +08:00
dekun 4686cf049a Require real ask depth for options and hedge opens.
Block mark-as-ask opens, show reference mark when no depth, cap sheets to ask size; leave close paths unchanged. Document in docs/更新文档.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:48:53 +08:00
dekun 195eeae295 Fix options select UI and false contract-missing quotes.
Keep the order host out of tbody wipes, sync pick-button labels, and retry/fallback OKX meta under rate limits so live contracts are not reported as missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:18:41 +08:00
dekun 1f767f16e4 Fix Gate key_focus 500 from invalid Jinja startswith filter.
Use (value|upper).startswith(...) so symbol whitelist select works when default is BTC/USDT.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:12:48 +08:00
dekun b057122d71 Fix options order panel vanishing after select.
Park the panel before strike-table rebuilds so soft chain refresh no longer destroys #opt-order-panel with innerHTML.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:10:45 +08:00
dekun 95e46ab803 Restyle options target-monitor banner for light mode.
Use a light panel with dark text instead of keeping the dark-theme black bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:06:01 +08:00
dekun 12c4e55f24 Fix intermittent empty options expiry dropdown after coin select.
Retry instrument fetch, reject empty chains instead of caching them, and ignore stale loadChain races.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:04:08 +08:00
dekun b50eebe37c Boost light-mode contrast on options position cards.
Darken labels, hints, and badges so call/put chips and metric text stay readable on white.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:00:30 +08:00
dekun 4c7197ad99 Fix options chain headers mixing list and T-view columns.
Thead rows used a .hidden class with no CSS rule on instance pages, so both header sets stayed visible.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 11:57:07 +08:00
dekun f0d5b47f50 Fix options add-on premium to sum all open legs for the contract.
Display, close gate, alerts, and full-close accounting no longer use only the latest fill row.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 11:11:32 +08:00
dekun 4a0b0def1d Center instance login form by fixing broken theme-bar layout.
Move the theme toggle inside body and stack it above the form so flex no longer pushes the card to the right.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 08:49:23 +08:00
dekun 19a4a5194d Use per-exchange PWA names and logos for instance app installs.
Show Binance/OKX/Gate 交易系统 with distinct exchange icons in manifests, apple titles, and login branding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 08:44:07 +08:00
dekun 717a3d5694 Add cumulative P&L banner to fund overview for at-a-glance profit/loss.
Expose period delta from equity curve start and surface it in the toolbar and summary cards with green/red cues.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 00:19:43 +08:00
dekun 0939274113 Fix roll docs page by resolving markdown from repo root.
The /strategy/roll/docs link looked under lib/strategy/ while 顺势加仓滚仓说明.md lives at the repository root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 22:29:14 +08:00
dekun a21b962bf1 Fix options mark price float junk and target index input rollback.
Skip full card redraw while the monitor target field is focused, and format mark/avg without relying on dusty server strings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 22:24:52 +08:00
dekun 6f934ecbbf Clarify 2x recycle is a target-close gate, not auto-close.
Rename UI copy from auto-close to target gate so 2x alone is not read as a close trigger.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 22:16:06 +08:00
dekun cbb7f954f5 Auto-cancel stale option close limits after pending TTL.
Default 10m via OKX_OPTIONS_PENDING_TTL_SECONDS; show age/countdown in pending panel; monitor loop cancels sell closes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 22:06:24 +08:00
dekun ee7be3e7f3 Align options realtime PnL with bid-net and show totals in stats.
Header float PnL now uses bid recycle minus premium like position cards. Stats adds realized/open/total net PnL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 22:00:45 +08:00
dekun 1909eea654 Use bid1-only option closes with hard-disabled market exits.
Manual close checks liquidity only; target auto still requires 2x recycle hold once, then reuses the shared bid1 executor. Add /options/guide doc and update hedge-plan refs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 21:49:06 +08:00
dekun ab8b2a74e2 Show cancellable pending option orders beside the order form.
Fetch live OKX option hangs on the right after submit, with refresh and one-click cancel.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 21:22:29 +08:00
dekun c2a0cea3f4 Gate option closes behind 2x recycle sustained for 2 minutes.
Require bid-side recoverable premium at least 2x cost continuously before target auto-close or depth close can fire.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 21:13:43 +08:00
dekun c025c06fac Block option auto-close on stub bids far below mark.
Reject target and depth closes when bid is a residual tick, and show invalid-bid UI instead of recycling at junk prices.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 21:05:54 +08:00
dekun e15eca76f3 Show option net P/L from bid recycle minus premium.
Rename floating P/L to net P/L, align ROI, and display bid depth as price/liquidity for only the levels needed to close.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 20:54:15 +08:00
dekun da3975e42e Fix BTC option prices losing trailing zeros in display.
Integer tick formatting was stripping zeros (1370 -> 137), so hedge-plan quotes looked wrong versus the options list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 17:12:33 +08:00
dekun 142b6de0f6 Stop repeat WeChat alerts on option target closes.
Commit monitor status before notify, and use a closing state so unfilled limits retry silently instead of re-alerting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 16:45:43 +08:00
dekun 944a211e4a Keep draft target input across position refresh until set.
Polling was re-rendering cards and wiping the field before 设定; drafts and focus are now restored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 16:10:09 +08:00
dekun 0bedb2e972 Clear target input after set and show estimated value/profit.
Position委托 row keeps the field empty for new entry and displays target value plus estimated PnL after arming.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 16:05:54 +08:00
dekun 61f63c456b Use bid-only limit closes when option index targets hit.
Target price is only for monitoring; auto flat waits for 买一 instead of falling back to mark.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 15:53:08 +08:00
dekun 280e59eb25 Cancel pending option sells before target auto-close.
Prevents duplicate sells from stacking into short opens when the bid book is empty and mark fallback retries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 15:45:36 +08:00
dekun bcb229fc9d Fix option close reduceOnly flag and use position mark when quote has no bid.
OKX expects reduceOnly as the string true; target auto-close also falls back to the live position mark price on empty books.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 15:43:19 +08:00
dekun cfc1d42c09 Fall back to mark price when option target close has no bid depth.
Keeps auto limit-close workable on thin books instead of stalling after the index target is hit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 15:37:55 +08:00
dekun d6823a2903 Add options index target monitors that auto limit-close on hit.
Position and order forms can arm a target; right-side and hub panels show active monitors; expiry remains the stop with no separate SL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 15:27:46 +08:00