Commit Graph

26 Commits

Author SHA1 Message Date
dekun 9cd81a3ea7 Isolate CTP in worker process and improve strategy roll UX.
Split vn.py into qihuo-ctp worker with IPC client bridge, keep CTP connected during breaks with cached account fallback, speed up strategy page loads, and allow off-session breakout roll submissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 12:37:44 +08:00
dekun cd636ff1c3 Fix account_risk_state missing on PostgreSQL: probe table before cache skip.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:29:46 +08:00
dekun d7ea7b9e8a Inline account_risk_state DDL in init_db; use autocommit for migration.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:26:13 +08:00
dekun ef790c8a80 Fix migration: per-table connections and skip non-serial setval.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:24:27 +08:00
dekun 6abe06d935 Ensure all PG tables on init; fix migration commits per table.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:22:54 +08:00
dekun e418c2dcec Fix SQLite migration: no app import, commit per table.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:22:21 +08:00
dekun 843b68b412 Stop PM2 before PostgreSQL init to free connection pool.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:17:29 +08:00
dekun 008f042fcc Fix init-only mode for PostgreSQL deploy script imports.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:14:43 +08:00
dekun a1f22624de Harden PostgreSQL deploy: auto-rollback on SQL errors, clean DB on migrate.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 08:13:51 +08:00
dekun 52aca456e9 Add PostgreSQL production backend to eliminate SQLite lock contention.
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>
2026-07-01 08:11:42 +08:00
dekun d324d30332 Schedule CTP disconnect 30 minutes after day and night session close.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 22:14:39 +08:00
dekun c5262a0a54 Add responsive mobile layout, records cards, and tablet settings fold fix.
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>
2026-06-29 16:42:38 +08:00
dekun 44bec23296 Add futures roll strategy with breakout monitoring and fixed-amount sizing.
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>
2026-06-29 12:05:21 +08:00
dekun 4f4c4bb9fc Fix missing recommend_payload import; raise small-account cap to 200k.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 23:27:19 +08:00
dekun 7bb80ba538 Limit tradable products to four varieties for accounts at or below 100k.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 23:18:27 +08:00
dekun 24190bf679 Add period selector and crypto-style trend plan preview table.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 22:52:47 +08:00
dekun d3b92de703 Fix trend strategy symbol input clearing on every keystroke.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 22:40:33 +08:00
dekun 69cf94d1df Fix symbol dropdown broken by JS syntax error in symbol.js.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 22:31:46 +08:00
dekun 7f8b4cfefd Label night-session products and hide day-only symbols at night.
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>
2026-06-26 22:27:47 +08:00
dekun f2940d41e9 Fix stale pending orders after CTP rejection or cancel.
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>
2026-06-26 22:21:15 +08:00
dekun ddfe2a52aa Merge orders and positions into one card and hide stale pending when CTP is off.
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>
2026-06-26 19:27:02 +08:00
dekun 5a6c89c662 feat: CTP/SimNow 配置迁入系统设置,登录失败即时报错
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 16:46:01 +08:00
dekun 36e26973fb fix: CTP 需 zh_CN.GB18030 中文 locale 而非仅 UTF-8
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:42:15 +08:00
dekun d368317c1b fix: 强制设置有效 locale 修复 vnpy_ctp CTP 登录崩溃
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:38:19 +08:00
dekun f73d436077 fix: CTP 连接后 locale 崩溃,PM2 设置 LANG=C.UTF-8
vnpy_ctp C++ 扩展在缺 locale 时会 terminate;补充 SimNow 备用前置说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:32:20 +08:00
dekun 28d6ae52b2 fix: CTP 连接捕获 SimNow 真实报错并增加诊断脚本
显式设置柜台环境=实盘;连接失败时解析 4097/登录拒单;scripts/test_simnow.py 供服务器排查。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:20:30 +08:00