Commit Graph

82 Commits

Author SHA1 Message Date
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 382a9a0e14 Use Sina-only market K-lines and editable admin login synced to .env.
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>
2026-06-26 13:53:12 +08:00
dekun 6905373401 Make settings cards collapsible and tighten backup layout.
All settings sections fold by default with persisted state; backup and password sit in one compact row.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 13:10:43 +08:00
dekun 98239d29c1 Add automatic database backup with download and restore docs.
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>
2026-06-26 13:04:48 +08:00
dekun 42f2dad52a Remove contract profile from navigation and retire its routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:32:30 +08:00
dekun cababd67f5 Reduce navigation flash with instant theme background and view transitions.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:26:57 +08:00
dekun aaf69329cb Use English tagline and open daily K-line when jumping from tradable symbols.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:23:52 +08:00
dekun 4eb5709d71 Rebrand product and enhance tradable symbols table with spec columns and K-line links.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 03:18:42 +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 bdfa21def8 Rename positions nav to order monitor and set as default landing page.
Remove stats recalculate button; login and home now open /positions without affecting refresh on other routes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 01:51:22 +08:00
dekun 1cc0cd5f8d Flatten records visuals and show stats summary in one row.
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>
2026-06-26 01:41:35 +08:00
dekun 64adce0e24 Flatten records page styling to match outer card background.
Use card-bg for equity curve and trade table instead of nested inner card colors.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 01:35:50 +08:00
dekun f457e7d6c9 Fix trade records table scroll with sticky header and themed background.
Use card CSS variables for 10-row viewport, sticky column headers, and dark/light theme sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 01:31:06 +08:00
dekun aad88a9e98 Add industry filter to recommendations and fix verify button width.
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>
2026-06-26 01:21:53 +08:00
dekun e5f675c6ca Sync equity curve with card theme and keep trade actions on one row.
Use CSS variables for chart colors with dark/light auto-switch; prevent trade action buttons from wrapping.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 01:11:21 +08:00
dekun 9f48f22d16 Gate order cancel to trading hours and sync trade logs from CTP.
Disable cancel UI outside sessions, query exchange fills for records, and label local vs counterparty rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 00:35:51 +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 ca541d5fc3 Auto-reconnect CTP with new front-end addresses after saving settings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:51:18 +08:00
dekun b641a4eaa0 Expand recommend table with gap, daily stats, and client-side sorting
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:36:31 +08:00
dekun 04b6f5e72d Add daily trend status to product recommendations with breakout priority
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:25:34 +08:00
dekun aba67a3d16 Compact CTP settings form into 3-row grid per card
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:16:52 +08:00
dekun 47dd946d66 fix: CTP 设置 SimNow/实盘卡片改为左右并列显示
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:11:54 +08:00
dekun 480000e195 feat: 系统设置 CTP 连接拆分为 SimNow/实盘可折叠卡片
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:09:56 +08:00
dekun 259d9e812d fix: CTP登录冷却持久化到数据库,取消页面自动连并刷新JS缓存
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 17:01:36 +08:00
dekun 5a6c89c662 feat: CTP/SimNow 配置迁入系统设置,登录失败即时报错
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 16:46:01 +08:00
dekun 240fbe7994 feat: 交易记录增加保证金占比与最新资金,上方展示资金曲线
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 16:17:22 +08:00
dekun de74ffe5b9 fix: 持仓卡片布局优化、闭盘禁用平仓、固定金额step修复
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:41:35 +08:00
dekun 9772f3d986 feat: 计仓改为固定手数/固定金额,推荐过滤与CTP保证金,下单与持仓UI优化
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:31:34 +08:00
dekun 63beda3c71 feat: 盈亏比与亏损额度展示,市价FAK报单,修复止盈止损保存失败
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 14:33:05 +08:00
dekun 040436e9cc feat: 持仓监控数据库优先显示,修复开仓重复与同步前空白
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 14:06:19 +08:00
dekun bbcc5607ad feat: 持仓监控后台 SSE 推送与浏览器缓存,刷新不再阻塞读柜台。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 13:49:44 +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 fc425c0e9f feat: 品种下拉统一展示推荐列表,与下方品种推荐表一致。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 13:01:20 +08:00
dekun 32f1fa2c66 fix: TradingView K线图表并修复品种推荐为空。
- 行情页改用 Lightweight Charts 标准蜡烛图(红跌绿涨)
- 修复 fee_rates 缺 source 列导致推荐刷新失败
- 空缓存自动重试,持仓页实时兜底计算推荐列表

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 12:33:49 +08:00
dekun 074551490f fix: 品种推荐改为最大手数并补算旧缓存。
- 最大手数 = floor(权益×保证金上限%÷1手保证金)
- 加载与 SSE 推送时实时补算,旧缓存缺字段时自动刷新

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 12:24:10 +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 73b9dfdfdb feat: 持仓保证金占比与止盈止损自动委托守护
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:20:15 +08:00
dekun 1d95950b5c fix: 手续费同步改为后台执行,避免阻塞 Web 请求
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:45:39 +08:00
dekun e01c011df5 feat: 手续费仅CTP每日后台同步入库,前端只读展示
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:33:14 +08:00
dekun de6815d481 fix: K线新浪历史补齐与手续费页布局及CTP批量同步
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:26:53 +08:00
dekun 3fe4add8e1 feat: 行情K线优先CTP tick聚合,修复手续费同步主力列表解析
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:18:43 +08:00
dekun 09f4649d79 ui: 系统设置卡片对齐,策略页说明与布局完善
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:10:21 +08:00
dekun eaca3d43ec ui: 手续费/设置布局优化,行情优先 CTP
手续费数据源与本地倍率并列双列;设置页去掉参考资金、缩小改密表单;CTP 连接时订阅柜台 tick 作为行情源。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 13:04:11 +08:00
dekun aea9aca472 feat: 品种推荐与下单显示主力合约
推荐列表展示当前主力代码;下单品种支持中文/代码搜索并按交易所分组选择主力合约。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 12:56:06 +08:00
dekun 3ba3be6035 ui: 持仓监控卡片与关键位同宽,完善多端与 PWA
改用 split-grid 全宽布局;手机/平板/电脑断点适配;更新 manifest 与 Service Worker 支持安装为 App。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 12:50:58 +08:00
dekun 67683f5562 ui: 顶栏透明、设置两列、下单与持仓监控优化
导航栏与页面背景一致;系统设置双列布局;下单三行表单与开仓状态反馈;持仓卡片增加平仓与止盈止损挂单展示。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 12:46:23 +08:00
dekun 528d9811e3 feat: 导航开关与 CTP 柜台手续费
系统设置可开关五类导航;手续费默认从 CTP 查询同步,本地/AKShare 作离线兜底;补充 FEES.md。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 12:19:56 +08:00
dekun b4250171d5 feat: CTP 断线重连、下单卡片优化、手数自动计算
后台每 30s 检测并重连;以损定仓填止损后自动算手数;开仓/平仓按钮并排对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:56:20 +08:00
dekun 62cd868f79 完善下单表单与 CTP 持仓,requirements 加入 vnpy 并更新部署文档
以损定仓/固定张数分栏下单、限价市价、持仓仅读柜台;DEPLOY 补充 SimNow 与 vnpy 安装说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 10:52:25 +08:00