Commit Graph

60 Commits

Author SHA1 Message Date
dekun 35088be097 Fix chart viewport regressions from tail refresh and period switch.
Remove pendingViewportEpoch, fetch only 30 tail bars on poll, restore wasViewingTail logic, and fix left-scroll range shift from actual merge delta.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:18:06 +08:00
dekun 11cc482599 Refactor market K-line storage with tiered retention and chunked loading.
Store 1m/5m/1h/12h/1d/1w with per-timeframe policies, aggregate 15m and 2h/4h on read, and support left-pan history fetches via before_ms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:27:16 +08:00
dekun 5ceacd8077 fix(hub): load full pre-entry history for archive chart pan/zoom
range=history serves archive seed through close (not now). Default view focuses hold period; user can scroll/zoom left to see global morphology before entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 23:20:37 +08:00
dekun 54c0b169c7 feat(hub): add open/close arrows on archive chart with continuous klines
Span chart window across hold period, fill 5m gaps for smooth aggregation, and mark entry/exit with lightweight-charts arrows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 23:14:40 +08:00
dekun 3052607280 fix(hub): merge strategy snapshots into archive for gate_bot
Include strategy_trade_snapshots when trade_records is empty, harden SQL for older schemas, and show per-exchange sync errors in the archive UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 23:02:46 +08:00
dekun 6a56928d59 feat(hub): add symbol archive with permanent 5m klines
Add /archive page, hub_symbol_archive.db, trade overlay, 4h background sync, and instance /api/hub/trades/archive. Document in hub-symbol-archive-kline.md with cross-links.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 22:51:48 +08:00
dekun f51d1c413a feat(hub): show funding, trading account and unrealized PnL on monitor cards
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 10:14:44 +08:00
dekun 8417784dd8 fix(hub): render AI coach summary and chat as Markdown
Reuse shared ai_review_render.js so summaries and coach replies display formatted lists and bold text instead of raw syntax.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:23:44 +08:00
dekun cee641ba5d feat(hub): add AI coach page with daily summary and chat
Aggregate four-account trades via hub_ai module and /api/hub/trades/today; store sessions in JSON; default OpenAI config matches instances.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 23:51:36 +08:00
dekun 24270944e7 fix(hub,gate): cross-margin TP/SL and dedupe hub conditional orders
Gate hedge position triggers use close=false; stop silent ccxt fallback on cross margin. Hub merges agent and Flask TP/SL by trigger price and labels Gate orders correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:48:04 +08:00
dekun ed0805538f fix(hub): sync TP/SL display after trend handoff to order monitor
Use order monitor plan prices on handoff cards and fill exchange TP/SL rows when Gate shows reduce-only orders without algo labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:39:11 +08:00
dekun f9301b92b9 feat(hub): trend plan breakeven and stop from monitor fullscreen
Proxy /api/hub/trend/stop and breakeven to instances; enable offset input and actions in hub UI. Add horizontal padding on strategy records page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 14:46:24 +08:00
dekun d14c629778 feat: add light/dark theme to exchange instances with hub SSO sync
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:52:27 +08:00
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 d07357b98e fix(hub): merge mark price from Flask snapshot and fix board refresh
Sync hub positions with instance price_snapshot (order_prices and position_marks).
Fix monitor board UI when hub restarts (version rewind) and queue snapshot fetches.
Expose board aggregate status on /api/ping for diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:44:01 +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 6a76993ca8 fix(hub): prevent monitor board stuck on slow aggregate polling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:47:11 +08:00
dekun d9b1b324f9 修复中控保本状态 2026-06-03 16:41:48 +08:00
dekun cf3e2ee1c9 feat: 持仓快照盈亏比与交易所止损已保本标识
盈亏比固定用开仓 initial_stop_loss 计算,人工改委托后不变化;轮询交易所止损触发价相对成交价判定已保本,四所实例与中控统一显示绿色标识。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:31:03 +08:00
dekun abcda762d8 行情区增加 3m/10m/20m/30m 与 2h/6h/8h/12h 周期
- hub_ohlcv_lib 扩展 CHART_TIMEFRAMES 与分钟快捷键映射

- 下拉框与 /api/chart/meta 同步新周期列表

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:21:55 +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 9115523df7 修复中控 2026-05-30 12:33:20 +08:00
dekun 61c4d54305 中控 2026-05-30 12:04:03 +08:00
dekun 8ffe46a344 中控 2026-05-30 11:57:00 +08:00
dekun aa92952b2d 移除一键保本bug 2026-05-28 12:43:55 +08:00
dekun 6bf7237ddb 更新中控 2026-05-27 09:30:31 +08:00
dekun 55f50a645b 更新中控 2026-05-27 09:23:56 +08:00
dekun 3ff17a4b60 修改前端 2026-05-25 17:42:53 +08:00
dekun 9556c4673d 修复中控 2026-05-25 13:47:34 +08:00
dekun 1347441bb3 修复中控 2026-05-25 13:43:22 +08:00
dekun 9c67a643a2 fix(hub): SSO in hub_sso without Flask for FastAPI hub 2026-05-25 13:40:54 +08:00
dekun d6d106d2cf 备份 2026-05-25 13:36:36 +08:00
dekun 325f12c0a7 增加反代 2026-05-25 11:49:53 +08:00
dekun 1e36086465 修复okx止盈止损 2026-05-25 11:25:14 +08:00
dekun 436d2aef6c 修复okx止盈止损 2026-05-25 11:19:33 +08:00
dekun 5f4f33cc10 修复中控 2026-05-25 08:02:06 +08:00
dekun e89708726f 增加手机端自适应 2026-05-25 07:46:45 +08:00
dekun 7beeb3500c hub放大排列 2026-05-25 07:37:33 +08:00
dekun 5935b5449e 前端ui 2026-05-24 08:44:16 +08:00
dekun 8b0607d83f 前端ui 2026-05-24 08:41:31 +08:00
dekun eebb658dc5 前端ui 2026-05-24 08:35:15 +08:00
dekun 695a785832 前端ui 2026-05-24 08:27:40 +08:00
dekun 88f4166bb7 前端ui 2026-05-24 08:15:31 +08:00
dekun 3b97a59562 中控增加条件单委托 2026-05-24 08:09:08 +08:00
dekun a3218f4fbd 中控增加条件单 2026-05-24 07:35:48 +08:00
dekun a4c13fd8cd 增加单仓平仓 2026-05-23 16:52:28 +08:00
dekun 952d57ab6d 修复bug 2026-05-23 16:39:35 +08:00
dekun 16b10e123e 修复登录 2026-05-22 12:21:58 +08:00
dekun d075471573 fix(hub): remove trade UI stubs, public ping, multipart dep 2026-05-22 12:07:26 +08:00