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>
Stop blocking page render on full trading live rebuild and CTP trade sync; use cached snapshot and background prime instead.
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>
Calendar shows daily closed trade count and PnL with emotion-day highlighting; day click loads review-first trade list. Use exchange-only entry average and improve vnpy position sync after CTP reconnect.
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>
Reduce poll pressure on phone/tablet, cache key prices, and handle live API errors gracefully. Rework mobile position and close cards with inline direction, compact P/L line, and detail modal.
Co-authored-by: Cursor <cursoragent@cursor.com>
Mobile gets compact trade/records UI with detail modals; static assets are cache-busted and settings cards fold correctly on tablet grid layout.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace percent-based risk with system fixed amount, support market/breakout add modes only, allow pending submission outside trading hours, and fix short breakout geometry plus route registration.
Co-authored-by: Cursor <cursoragent@cursor.com>
Read margin ratios from CTP instrument query and margin-rate API instead of vnpy ContractData (which lacks ratios). Keep occupied margin on position UseMargin; use per-lot max rate for recommend table.
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>
Match pending monitors to filled positions, reconcile pending on fast refresh, and refresh CTP before promote.
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>
Correct main_code order in product refresh, refresh on CTP connect, and limit reconnect to trading or premarket windows.
Co-authored-by: Cursor <cursoragent@cursor.com>
Document per-module order logic, risk rules, and WeChat message templates with a central INDEX for navigation.
Co-authored-by: Cursor <cursoragent@cursor.com>