Commit Graph

150 Commits

Author SHA1 Message Date
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 bee9539852 fix(hub): use cyan accent in AI chat markdown
Apply accent color to chat headings, bold text, and coach role label instead of purple.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:19:37 +08:00
dekun b98efbd27d fix(hub): use cyan accent for AI summary headings in dark theme
Keep wine-red emphasis in light theme; align dark mode with the hub color system.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:16:36 +08:00
dekun b828026c23 fix(hub): refine AI summary heading style for light and dark themes
Replace red text with white stroke by theme-aware accent bar and soft background tint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:12:29 +08:00
dekun f8220762c0 fix(hub): align AI summary trades with records and restyle headings
- Query trade_records with trading-day window and reviewed fields instead of missing session_date column

- Style summary headings and account names as red text with white stroke

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:07:16 +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
dekun ebadcb1119 fix(hub): polish AI coach UI with PnL colors and chat roles
Equal-height summary/chat panels, colored closed/float PnL, owner/coach labels, and optimistic thinking state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:10:50 +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 995ee8d2e1 fix: prevent theme flash when navigating instance pages from hub iframe
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:23:51 +08:00
dekun 934e48b9a8 fix: show risk amount only in full-margin mode across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 09:08:45 +08:00
dekun 806350231e fix(hub): show contract-based unrealized PnL in monitor and chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:20:36 +08:00
dekun ef8656e95d fix(hub): define mo in buildPositionMarketContext
Fixes monitor grid crash ReferenceError mo is not defined when opening market from position card.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:15:10 +08:00
dekun fb20a12b02 fix(hub): show monitor page instead of overlapping market page
page-market id contained substring monitor so setActiveNav kept both pages visible and hid the grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:13:03 +08:00
dekun c9ca106b81 fix(hub): recalc market floating PnL from live chart mark
Use plan margin x leverage x price change with latest K-line close instead of stale board snapshot floating_pnl.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:09:35 +08:00
dekun e6361a7fcc fix(hub): live market PnL and Gate drag SL place
Parse Gate unrealised_pnl in agent; refresh hub market floating PnL from board and trends; clamp Gate TP/SL triggers before place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:02:23 +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 e39fac2c16 feat(hub): show floating PnL on market page and drag stop-loss to place TP/SL
Pass unrealized PnL from monitor jump context, refresh from board snapshot, and let users drag the SL price line to call the same place-tpsl API as the monitor entrust dialog.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:31:45 +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 9d12323ce6 style(hub): fix light-theme load button and market position panel colors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:14:48 +08:00
dekun e99c6cef08 style(hub): refine light theme contrast and theme-aware fullscreen UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:08:35 +08:00
dekun d1914df46f feat(hub): add dark/light theme toggle with moon and sun icons
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:03:48 +08:00
dekun b394e495ca chore: remove instance Windows scripts and screen/systemd helpers
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:56:32 +08:00
dekun 4569e070fd chore: remove Windows deployment scripts and update hub usage examples
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:53:42 +08:00
dekun 1282293e91 docs: unify Ubuntu root /opt PM2 deployment and refresh README
Add docs/ubuntu-server.md; remove Windows and alternate process managers from deployment guides; index strategy, key monitor, TP/SL, breakeven, and replay docs in root README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:48:54 +08:00
dekun 546bc7bcf1 fix(hub): two-column trend plan card; docs for records and hub layout
Left column shows plan metrics, right column DCA table, footer for breakeven and snapshot info; update strategy and exchange usage docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:59:47 +08:00
dekun 7037dc2334 fix(hub): align trend pullback card with instance layout
Match strategy page plan card: 3x3 metrics, DCA table, breakeven row, snapshot footer; PnL percent on plan margin.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:51:13 +08:00
dekun 3fb2023efb feat: strategy trade snapshots, DCA detail, and hub trend layout
Persist ended trend pullback and roll group snapshots to a unified records page; show replenishment tiers on instance and hub cards with horizontal single-position layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:45:27 +08:00
dekun 1a6b5f55a1 fix: regenerate clean app icons with Pillow (fix corrupted favicon)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:22:08 +08:00
dekun e03cce20d6 feat: add brand icons for Chrome shortcuts and PWA manifest
Dark cyan-green candlestick icon for hub and four exchanges; generate/sync scripts and docs/shortcut-icon.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:17:22 +08:00
dekun ed669fab80 fix(hub): show trend plan leverage, base, ratio, mark and floating PnL
Position and trend plan cards read sizing from trend_pullback_plans; merge agent mark/PnL; compute position_ratio_pct in hub enrich.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:13:44 +08:00
dekun 98c904c2d1 feat(hub): align trend pullback display with instance in fullscreen
Position cards show trend plan source, risk%, program TP price and RR; trend section uses plan grid; hub API enriches floating PnL and planned_rr.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:09:04 +08:00
dekun 1b3f661bad fix: label trend breakeven handoff as 趋势回调 across four exchanges
Set order monitor and trade record source to trend pullback after handoff; unify hub and instance display; add migration script for legacy rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 06:30:14 +08:00
dekun 97e0355209 ui(hub): remove monitor and market page description hints
Drop page-desc and collapsible hint-box from monitor and market headers for a cleaner layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:48:24 +08:00
dekun 2c01d11fe1 style(hub): color-code monitor card strategy stat chips
Use shared cyan for breakout/fib keys, purple for watch keys, green for trends, and orange for roll groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:30:33 +08:00
dekun 98038b1945 feat(hub): show key/trend/roll counts on monitor cards
Add per-card strategy stats chips for breakout, fib, and watch key levels plus trend and roll plan counts when non-zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:25:43 +08:00
dekun 7957a62c65 fix(hub): use single position table header on desktop monitor cards
Render all exchange positions in one table row group instead of repeating column headers per symbol.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:20:34 +08:00
dekun 833c51e34a feat(hub): simplify desktop monitor cards to positions only
Move orders, key levels, entrust, trend plans, and roll groups to fullscreen detail view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:15:55 +08:00
dekun ed3ff747f4 feat(hub): mobile 2x2 exchange alert dashboard tiles
Phone monitor list shows per-exchange tiles with offline, >10% float loss, and missing SL alerts; tap opens full desktop-style detail view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:07:59 +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 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