Commit Graph

82 Commits

Author SHA1 Message Date
dekun 850ffcd7d2 style(risk): polish account status badge for light and dark themes
Extract shared account_risk_badge.css with theme-aware contrast, dot indicator, and hub/instance layout fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 17:37:32 +08:00
dekun 869728ce10 feat: archive trades by close time and show open time on live positions
Sort inner-archive daily trades by closed_at_ms; add open time and live hold duration to instance and hub position cards, with exchange margin on hub footer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 06:20:18 +08:00
dekun 1fd0003fc8 feat(hub): show server CPU memory disk and network status on monitor page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:04:05 +08:00
dekun a9637fafb2 fix(hub): archive labels, symbol column, and time-close dropdown
Force exchange_key on archive sync; add contract column and tag select styles on inner-light-mind; serve time_close_ui.js on instances so order/key time-close duration can be selected.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 19:44:51 +08:00
dekun 959593cdab feat: add timed position close (1h/2h/4h) for key levels and live orders
Program monitors open positions and market-closes at deadline; UI shows label and countdown on instance and hub boards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 19:30:16 +08:00
dekun 7b0b8996fe feat(hub): add period date range and trade stats to inner-light-mind
Support today/week/month/custom range selection with sick count, PnL, and per-exchange breakdown; update docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 18:09:39 +08:00
dekun bb800b876b feat(hub): redesign archive as inner-light-mind journal
Rename archive to 内照明心 with daily trade records by default, review quotes sidebar, on-demand chart, sick-row highlighting, and new daily-trades/quotes APIs.
2026-06-11 17:43:45 +08:00
dekun 007e089121 feat(hub): settings toggles for funds and dashboard nav
Add show_nav_funds and show_nav_dashboard in hub_settings display prefs to hide top nav entries and redirect direct URL access.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 11:00:19 +08:00
dekun 07e8604ea6 feat(hub): dashboard SSE push, light-theme cards, simplify AI coach
Replace dashboard polling with backend SSE and snapshot refresh. Restyle for light/dark theme with soft card glow instead of neon. Remove Today's Summary from AI page; keep trading and general chat only. Update hub documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 10:53:50 +08:00
dekun 582ada7e60 feat(hub): add data dashboard and AI chat with session history
Add /dashboard with daily PnL overview and loss alerts. Extend AI coach chat with history sidebar, delete/switch sessions, message copy, and trading vs general bot modes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 10:42:33 +08:00
dekun a45a3b18e2 feat: hub setting to hide account balances and PnL in monitor
Persist show_account_pnl in hub_settings.json; refine key monitor panel layout with right-aligned live stats and scrollable history (max 8 rows).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 10:15:57 +08:00
dekun 77c7bbbb13 feat: add hub fund overview tab with 180-day equity curves
Add /funds page for total and per-account balance (funding+trading), drawdown, and daily snapshots from monitor board aggregation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 16:50:47 +08:00
dekun 59a45ed027 fix: Gate hub close sync and trade record open stop-loss snapshot
Sync order monitors from Gate position history after hub flat close. Store and display initial_stop_loss in trade records instead of post-amend exchange stops.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:01:59 +08:00
dekun f7d94f67d7 fix: sync live TP/SL to position cards after entrust changes
Use exchange TP/SL for display and DB sync on price_snapshot polls, refresh instance UI cells on each tick, and merge live values into hub monitor board.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 11:06:27 +08:00
dekun 55a979eee5 fix: show archive chart times in UTC+8 and parse Beijing wall clock
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:47:09 +08:00
dekun 93b84da72e fix: invalidate stale 12-item volume rank cache and force full top20 refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:01:27 +08:00
dekun 89a58c7323 fix: exchange-specific volume rank APIs for OKX and full top20
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 15:53:41 +08:00
dekun 4bf0c2363f feat: daily volume top20 rank per exchange in market page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 15:46:36 +08:00
dekun 46963a4498 feat: archive entry type from review, prune stale trades on sync, manual delete
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:39:27 +08:00
dekun e68e29629e feat: push chart tail candles over SSE for faster market refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:24:25 +08:00
dekun ca6ef59a14 Add clear-and-refetch for hub K-line cache.
Force refresh wipes the series in hub_kline.db before pulling from the exchange; add a Linux clear script and rename the UI button to 清库重拉.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:31:16 +08:00
dekun cfa28e7f4e Fix hub full-close double-booking trend plans.
Sync active plans after hub position close, merge final close snapshots per plan, and backfill missing trade records when ending an already-stopped plan.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 09:06:36 +08:00
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