Commit Graph

10 Commits

Author SHA1 Message Date
dekun ae28bc6273 Count roll groups as one position slot and protect monitors during roll.
Include active roll groups in deduped position slots; normalize CTP position keys in reconcile; skip closing monitors tied to active roll groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 23:04:34 +08:00
dekun 6710692dfb Fix position limit to count distinct slots and speed up strategy page.
Roll/add-on shares one monitor per symbol+direction so it no longer inflates the active position count; strategy page skips full CTP sync when monitors already exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 22:49:32 +08:00
dekun 530738ae93 Fix roll first-lots display and make market add use pending orders.
Store initial_lots on roll groups, submit market roll as CTP pending legs with cancel closing empty groups, and backfill first-lots for existing active groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 22:12:04 +08:00
dekun 3c53b2063f Sync CTP monitors on strategy page load for roll trading.
Revive and sync active monitors from live positions before listing roll candidates, show ineligible monitors with reasons, and validate eligibility on preview.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 21:55:50 +08:00
dekun 075fae37ec Fix float P/L when using OpenCost entry and clear CTP hint on connect.
Recalculate position quotes from resolved entry instead of stale CTP PositionProfit, and hide the auto-connect disabled banner once CTP is connected.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 21:24:48 +08:00
dekun dca773d6be Fix CTP open average price direction mapping and resolution order.
Correct PosiDirection 2=long/3=short so OpenCost caches under the right key, prefer open_cost over PositionCost for entry and float P/L, and refresh the cache when incomplete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 21:13:28 +08:00
dekun 972ab5d08b Route business quotes and K-lines to CTP; keep Sina only for market chart page.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 15:14:13 +08:00
dekun 98d63f38bf Fix dashboard position limit flicker by unifying active count across APIs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 14:53:04 +08:00
dekun 658982d2b9 Speed up CTP account display: refresh equity on fast snapshot without waiting for full position sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 15:02:37 +08:00
dekun e5a586f903 Restructure into modules/ with single-process CTP and config/ layout.
Move business code under modules/, env template to config/, PM2 single qihuo process, and _legacy shims for old imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 14:42:16 +08:00