Commit Graph

126 Commits

Author SHA1 Message Date
dekun 8e810154ca Add open-instance to trade page and mobile/tablet responsive layouts.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 16:38:30 +08:00
dekun 091317276d Add entry plan page with CRUD, archive flow, and win-rate stats.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 16:19:56 +08:00
dekun 073a382d41 Unify key support/resistance monitor type and fix form parity.
Merge 关键阻力位/关键支撑位 into 关键支撑阻力, share key_monitor_form.js across hub and new-tab views, and add hub shortcut to /key_monitor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 08:31:14 +08:00
dekun 97370926d6 feat(risk): show live countdown on freeze status badges
Expose freeze_until_ms from risk API and tick hub/instance badges with remaining 1h/4h/daily time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 17:41:04 +08:00
dekun e470c5952f feat(hub): add macro calendar for pre-release risk alerts
Manual FOMC/CPI/employment entries in settings drive ±1h monitor banners without touching exchange instances.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 11:52:30 +08:00
dekun d8dccb8606 fix(hub): stop instance iframe nav flash after account status badge
Load account_risk_badge.css before body paint, skip redundant hub theme re-apply, remove iframe hide overlay, and disable badge transitions in hub embed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:36:48 +08:00
dekun 6520234bd8 fix(hub): eliminate iframe flash when switching instance nav tabs
Use soft in-frame navigation and loading overlay in hub instance shell; pass embed=1 for iframe SSO opens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:27:52 +08:00
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 e307eef690 feat(risk): add account cooldown and daily freeze after manual/external close
Implements shared account_risk_lib with 4h/1h cooloff and daily freeze rules, wires hooks into all four exchange apps and hub monitor UI, with tests and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 17:05:19 +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 ad1c08a2cc fix(hub): remove duplicate AI chat declarations causing white screen
Drop redeclared AI_CHAT_MAX_ATTACHMENTS and aiChatPendingFiles in app.js that broke script parsing after the chat perf update.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 02:02:33 +08:00
dekun 467d160f4d perf(hub-ai): reduce CPU load during trading coach chat
Cache chat context, parallelize exchange fetches, skip fund history writes, defer rolling summary to a background thread, and cache markdown rendering on the client.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 01:59:43 +08:00
dekun 28a23008f3 feat(hub-ai): paste screenshots in chat and include position TP/SL in coach context
Let users paste images into AI chat with removable pending attachments, and feed exchange/monitor stop-loss and take-profit into trading coach snapshots so replies reflect actual protection on open positions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 01:53:24 +08:00
dekun c95ca6ac35 fix(hub): color host status summary metrics green/red and bust css cache
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:26:26 +08:00
dekun 47910e6cb3 fix(hub): use green/red host status indicator at 85% CPU memory disk threshold
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:22:49 +08:00
dekun c1e0e52f8c fix(hub): restore monitor host status panel after missing pref helpers
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:18:34 +08:00
dekun 9e395b6732 feat(hub): fold host status by default, add entrust on grid positions, alert on high CPU/memory
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:14:48 +08:00
dekun a89b446d74 fix(hub): improve monitor host status bar layout and document psutil setup
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 14:10:00 +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 6a1f2608b5 feat(hub): rolling chat summary to cap AI context and prevent mid-session failures
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 21:51:34 +08:00
dekun 180aff5310 feat(hub): add archive quote AI coach review from inner light page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 21:10:39 +08:00
dekun a9c40097b3 feat(hub): time-close countdown in monitor position table
Show timed-close badge with live countdown next to contract name in the grid holdings table.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 20:24:30 +08:00
dekun 0d82cd2ad3 feat: show time-close countdown after symbol in monitor area
Move timed-close badge next to contract name on hub board and instance position cards; refresh countdown on board render.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 20:20:13 +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 65d2bc5e00 fix(hub): restore desktop monitor layout in PWA
Split mobile AI layout from viewport-only mobile detection so standalone desktop app uses full monitor cards again.
2026-06-11 11:41:03 +08:00
dekun 51252d5dda fix(hub): keep mobile PWA AI navigation visible
Fix keyboard detection in standalone app so top nav and AI tabs stay visible; recognize PWA display mode for mobile layout.
2026-06-11 11:35:44 +08:00
dekun 08ae171e48 feat(hub): mobile AI one-screen and dashboard monitor counts
Fix mobile AI to scroll only in the chat area. Dashboard cards show monitor item counts with expand-to-fullscreen and color-coded position floating P&L.
2026-06-11 11:27:28 +08:00
dekun 1042fdeef3 feat(hub): mobile AI tabs and dashboard position lines
Mobile AI coach uses four top tabs (trading, general, history, new) with single-panel view and wider desktop history. Dashboard account cards show key levels and positions one per line with colored float PnL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 11:16:28 +08:00
dekun c59a17f9ac fix(hub): improve mobile AI coach layout
Move new-chat button to top toolbar to prevent overlap, compact chrome, hide chrome when keyboard opens, and soften mobile tab styling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 11:06:47 +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 401ee2f130 fix: stabilize AI coach chat against truncation and empty replies
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 06:27:06 +08:00
dekun 9602acafb2 feat: restyle fund overview with HUD UI and nav reorder
Move funds before monitor in nav while keeping monitor the default landing page; use card layout with curves in fullscreen and a tech/AI-themed funds dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 17:12:58 +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 02d2a6c70b fix: mobile hub AI keyboard layout and instance top nav scroll
Sync hub shell to visualViewport when the keyboard opens to prevent white screen above chat input. Make instance tabs horizontally scrollable with active tab centered on phone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 17:16:00 +08:00
dekun ea3ef71477 feat: optimize hub mobile layout with chat-first AI coach tabs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:47:19 +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 2786acf884 fix: feed today-only data to AI daily summary to reduce hallucination
Shrink summary context and prompts to today's trades and positions only, and tighten anti-fabrication rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 09:39:40 +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 6a4ec69dba fix(trend): align hub and four-exchange trend plan display
Unify gate_bot with shared enrich_trend_plan for strategy pages and hub monitor, reconcile DCA avg with live entry price, and fix missing fill price display.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 18:05:30 +08:00
dekun d56d9050aa fix(trend): use money RR, track DCA fills, snapshot before close
Align running-plan header and DCA table with risk-budget RR, record actual fill prices after each leg, and save pre-close snapshots on stop/TP/handoff across hub and exchanges.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 17:34:50 +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 62e48dab92 feat(hub): enrich AI coach with fund history, closed trades, and chat uploads
- Add 15-day fund snapshot store and /api/hub/account on all instances

- Summary includes yesterday/today trades, fund columns, and section 5 操作建议

- Chat context distinguishes empty positions from local monitors

- Support image/document attachments in AI chat

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 08:54:20 +08:00
dekun 51c59b073b fix(hub): simplify AI coach header actions
Hide model name labels and style New Chat as a primary button matching Generate Summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:40:58 +08:00
dekun dfcf0f88fb fix(hub): add section icons and color PnL in AI summary table
Show emoji headings for overview, accounts, alerts, and data notes; apply green/red styling to table PnL columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:33:44 +08:00
dekun a5f5239be9 feat(hub): render AI summary account breakdown as icon table
Replace pipe-separated account lines with a structured table from stats_snapshot, including exchange icons and position remarks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:28:24 +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 821e260912 fix(hub): keep AI coach page within one viewport
Lock page height and scroll summary/chat inside equal panels instead of extending the document.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:15:40 +08:00