Commit Graph

119 Commits

Author SHA1 Message Date
dekun 6f8f0968c8 feat(hub): background chart poll with SSE for positions and market watch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:39:26 +08:00
dekun 2a9602610e fix(hub): align Binance chart ticks and improve monitor mark price
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:33:59 +08:00
dekun c1fda1e7d5 feat(hub): show exchange mark price on monitor positions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:25:23 +08:00
dekun 5b6babd699 feat(hub): background board poll every 5s with SSE snapshot updates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:17:23 +08:00
dekun 7900a68d07 fix(hub): preserve key monitors when enrich_monitor returns partial payload
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:34:39 +08:00
dekun f95118065d feat(hub): exchange price precision, entry price, and trend DCA display
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:25:24 +08:00
dekun fac28c402b fix(okx): use OCO algo orders for hub TP/SL to avoid instant close
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:00:22 +08:00
dekun 2d8f65bf1d fix(hub): 修复币安行情区 unexpected base 价格精度
normalize_price_tick 对齐 tick 为 10^-n;chart.js 使用整数 base 并在 applyOptions 失败时回退安全 priceFormat。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:36:51 +08:00
dekun c56326734e fix(hub): 修复行情区 K 线 Gate 分页与图表 unexpected base
Gate OHLCV 分页在接近当前时间时停止并容错 from>to;分页失败时用 limit 兜底。chart.js 为 priceFormat 增加整数 base,setData 失败时回退默认精度。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:28:42 +08:00
dekun cf3e2ee1c9 feat: 持仓快照盈亏比与交易所止损已保本标识
盈亏比固定用开仓 initial_stop_loss 计算,人工改委托后不变化;轮询交易所止损触发价相对成交价判定已保本,四所实例与中控统一显示绿色标识。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:31:03 +08:00
dekun a5f4ad8e97 fix(okx): show negative unrealized PnL on strategy page
Parse signed upl/unrealizedPnl from CCXT positions and fall back to calc_pnl when exchange metrics are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 16:02:24 +08:00
dekun fdca82ea26 移除行情区 3m/10m/20m/6h/8h 周期
保留 30m、2h、12h;12h 仍支持从 1h 聚合

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:33:33 +08:00
dekun eebc50cffa 修复 6h/8h/12h K 线间隔异常与 Gate 无原生 6h 问题
- 校验 K 线中位间隔,异常时从 1h 聚合

- 分页按实际 K 线步进 since;补充聚合单元测试

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:29:25 +08:00
dekun bfffc7d984 修复 OKX K 线无 since 时只拉 300 根的问题,并加入行情快捷键
- fetch_ohlcv_for_hub:无 since 时按目标根数分页拉取(OKX/Gate 单次约 300)

- hub_kline_store 全量补拉传 fetch_start_ms

- 行情区:数字键切换周期、Ctrl+空格全屏、Esc 退出全屏

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:51:37 +08:00
dekun 84ac9134db 行情区:K线全屏、可选技术指标与交易所价格精度对齐
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:24:36 +08:00
dekun 73a51fd996 修复 Gate K 线分页:单次不足 300 根时继续拉取至最新
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 13:15:35 +08:00
dekun 113d8c1669 行情区图表:成交量、十字线 OHLCV、可视高低点、日线满 500 根
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 11:12:10 +08:00
dekun ba681c7a58 中控行情区与 K 线本地库(15 天滚动、按需拉取)
新增行情区单图与周期切换,K 线优先读 hub_kline.db,不足时经各实例 /api/hub/ohlcv 补齐;无后台定时更新。含回滚标签说明与单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 10:58:59 +08:00
dekun ef99fb6c2e 修复支撑阻力企业微信重复 2026-06-02 06:55:57 +08:00