When the exchange rejects or cancels an order, close local pending monitors once the order leaves CTP active list instead of waiting for the full timeout.
Co-authored-by: Cursor <cursoragent@cursor.com>
Turbo swapping broke page CSS/JS across stats, settings, market, and trade. Restore full page loads; keep external base.css and link prefetch.
Co-authored-by: Cursor <cursoragent@cursor.com>
Extract settings.js, preserve inline scripts from raw HTML (DOMParser strips them), and load trade config via JSON script tag.
Co-authored-by: Cursor <cursoragent@cursor.com>
Wait for page CSS before swapping content, hoist inline styles to head, and boot page scripts immediately when DOM markers exist.
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove view-transition lag, swap main content without full reload, prefetch pages, and tear down SSE timers on leave.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stop showing DB pending orders while disconnected, invalidate session cache when CTP is down, and add a local DB clear script without embedded credentials.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add in-memory order/position books fed by CTP events, split active orders above positions in the UI, tick-triggered local SL/TP, and 30-second full calibration.
Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve CZCE/DCE symbols to the correct exchange for orders, dedupe stop-loss closes and trade logs, and rely on CTP sync for authoritative records.
Co-authored-by: Cursor <cursoragent@cursor.com>
Market page uses Sina for quotes and bars with an auto-follow toggle and incremental chart updates while panning. Settings lets users change username and password, persisting to the database and .env.
Co-authored-by: Cursor <cursoragent@cursor.com>
All settings sections fold by default with persisted state; backup and password sit in one compact row.
Co-authored-by: Cursor <cursoragent@cursor.com>
Back up futures.db and uploads to /root/qihuo_backup on a daily schedule, expose backup downloads in settings, and document cross-server restore.
Co-authored-by: Cursor <cursoragent@cursor.com>
Retry stats cache commits, serialize refresh, and fall back to read-only compute so the stats API does not return 500 when the database is briefly locked.
Co-authored-by: Cursor <cursoragent@cursor.com>
Rewrite module docs for order monitor, CTP sync, and stats; remove obsolete simulated-position and UI descriptions.
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove stats recalculate button; login and home now open /positions without affecting refresh on other routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use transparent chart/table surfaces on records page; merge 14 stat metrics into a single compact card row.
Co-authored-by: Cursor <cursoragent@cursor.com>
Show category, turnover, and per-industry counts; clarify volume is in lots. Prevent trade-save button from stretching full column width.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use CSS variables for chart colors with dark/light auto-switch; prevent trade action buttons from wrapping.
Co-authored-by: Cursor <cursoragent@cursor.com>
Skip duplicate auto-connect when TD is logged in, stop aggressive query_position hooks, and throttle position refresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
Disable cancel UI outside sessions, query exchange fills for records, and label local vs counterparty rows.
Co-authored-by: Cursor <cursoragent@cursor.com>