Commit Graph

23 Commits

Author SHA1 Message Date
dekun 0b924fca87 Fix trade log equity_after to chain from initial capital by close time.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 21:41:37 +08:00
dekun ec4199b82c Restore stop-loss and take-profit monitors after restart and CTP reconnect.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 09:24:37 +08:00
dekun 840e88daad Add key-level auto trade, AI analysis, and trading UX improvements.
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>
2026-06-28 10:36:56 +08:00
dekun e18d5feb72 Apply 200k scope when CTP offline; trailing breakeven order UX.
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>
2026-06-27 23:57:11 +08:00
dekun 3a150dd3d6 Implement CTP-authoritative trading UI with event-driven state.
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>
2026-06-26 18:12:11 +08:00
dekun 4ef33a367f Fix CTP exchange routing for non-SHFE contracts and duplicate trade closes.
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>
2026-06-26 14:06:49 +08:00
dekun d3955309d9 Persist CTP margin, ratio, and fees to DB; use exchange commission in trade logs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 11:36:56 +08:00
dekun ab9987e4c7 Add personal license agreement and rename product section to tradable symbols.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 02:52:45 +08:00
dekun 7133a0e448 Fix CTP vnctptd segfault restart loop by serializing reconnect.
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>
2026-06-26 00:49:17 +08:00
dekun a23f2c80ca Track open orders as pending until CTP fill, with cancel and timeout.
Add configurable pending timeout in settings and clearer CTP password save feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 00:05:45 +08:00
dekun 240fbe7994 feat: 交易记录增加保证金占比与最新资金,上方展示资金曲线
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 16:17:22 +08:00
dekun 649c064c2f feat: 期货下单写入DB来源与开仓时间,CTP同步均价保证金现价
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:59:15 +08:00
dekun c302e1f3ca fix: avoid SQLite lock on fast position poll by skipping DB writes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:14:22 +08:00
dekun 4d60b958ce fix: 开仓时间读CTP OpenDate,止盈止损持久化且重启不丢失
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:05:58 +08:00
dekun 367f32dd82 fix: 持仓接口实时拉取并回写本地监控,修复有仓不显示
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 14:14:21 +08:00
dekun 040436e9cc feat: 持仓监控数据库优先显示,修复开仓重复与同步前空白
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 14:06:19 +08:00
dekun f31164076f feat: 非交易时段禁开仓、移动保本与交易结果分类。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 13:33:17 +08:00
dekun 598a1407e1 feat: 止盈止损秒级监控市价平仓记交易记录,并加手数超限提醒。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 13:16:19 +08:00
dekun 9875ee6d44 本地监控止盈止损、盘前自动连CTP,并完善保证金与推荐手数。
- 止盈止损改为程序本地监控,触发后市价平仓(含跳空)
- 交易前30分钟后台自动连接 CTP
- 保证金占用上限默认30%,可在系统设置修改
- K线标准蜡烛图红跌绿涨,费率表全宽固定表头
- 品种推荐按保证金比例×总资金计算推荐手数

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 12:18:18 +08:00
dekun fe1b651900 fix: 止盈止损委托校验现价并在平仓后撤余单
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:35:20 +08:00
dekun 397e9cd9d8 fix: SHFE止盈止损平仓改平今并限制重复报单
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:30:41 +08:00
dekun f6ee13765d fix: sl_tp_guard 从 ctp_symbol 导入 ths_to_vnpy_symbol
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:23:06 +08:00
dekun 73b9dfdfdb feat: 持仓保证金占比与止盈止损自动委托守护
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:20:15 +08:00