Support DATABASE_URL with connection pooling, pg_dump backups, SQLite migration script, and deploy_postgres.sh with docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve trading state when CTP memory is empty, bootstrap equity/positions on page load, stabilize risk status from DB monitors, and remove app-layer manual close cooling periods.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stop clipping pos cards and match trailing-BE stop detection for the badge. On tablet, align order and live-trading panels to equal height with internal scroll; keep desktop positions scrollable after three cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
Recalculate tradable symbol budgets from remaining margin after CTP usage and refresh the table on position updates.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use modal for monitor upsert with trailing checkbox, refresh CTP tick every second, and push full snapshot after orders.
Co-authored-by: Cursor <cursoragent@cursor.com>
Unpack margin_one_lot correctly for fixed-amount sizing, use exchange klines for breakout detection, and notify on pending auto orders.
Co-authored-by: Cursor <cursoragent@cursor.com>
Key monitors use 5m close triggers with WeChat alerts and box/convergence auto orders; add pending-order worker, structured WeChat notify, AI settings/messages, session clock, CTP margin sizing, and dual-layer position limits.
Co-authored-by: Cursor <cursoragent@cursor.com>
When SimNow or live CTP is disconnected, default to the four-product whitelist regardless of reference capital. Trailing breakeven defaults off; when enabled hide take-profit and risk-reward, monitor exits via trailing stop only. Document both behaviors in TRADING.md and FEATURES.md.
Co-authored-by: Cursor <cursoragent@cursor.com>
Mark tradable varieties with a night tag; during 21:00-02:30 filter out index futures and other products without night sessions from symbol picker and recommend list.
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>
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>
Disable cancel UI outside sessions, query exchange fills for records, and label local vs counterparty rows.
Co-authored-by: Cursor <cursoragent@cursor.com>