Commit Graph

288 Commits

Author SHA1 Message Date
dekun 38f4280bb8 fix: UTC+8 market chart times and archive full history K-line load
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:55:48 +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 947b58084d ui: add Top20 button to market chart fullscreen toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:37:05 +08:00
dekun 5fb4a10638 ui: show Top20 rank sheet below toolbar instead of over chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:11:11 +08:00
dekun 4c55932906 fix: Top20 dropdown floats above chart with fixed positioning
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:08:05 +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 09eb9dc475 ui: remove crosshair, channel and text tools from draw toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 13:05:37 +08:00
dekun 94679f10d0 feat: right-click context menu and Delete key for chart drawings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 13:02:28 +08:00
dekun d659cf7a4c fix: TV-style fib colors, range badge, polyline preview, one-shot tools
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:57:23 +08:00
dekun ef57ba13c5 fix: drag-to-draw for range and fibonacci like TradingView
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:50:25 +08:00
dekun ef57872d14 fix: market drawing tools overlay alignment and pointer handling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:45:47 +08:00
dekun 26a4c04b88 feat: add vertical drawing toolbar on market chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:41:52 +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 4918699276 feat: show review fields in symbol archive trade table
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:20:29 +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 2095839fc3 Fix hub chart skipping remote fetch when DB bars are discontinuous.
Trim gaps before deciding fetch need, always backfill short contiguous tails, and relax gap detection so tail polls do not block full history loads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:27:00 +08:00
dekun 440d1ecbc9 Fix discontinuous hub chart candles from orphaned DB bars.
Keep only the latest contiguous K-line segment, purge isolated stale rows, and backfill when the tail is still shorter than the initial limit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:21:01 +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 b34aefbcc4 Patch tail candles without resetting chart viewport.
When auto-follow is off, refresh only updates the latest bars via series.update instead of setData so zoom and pan stay fixed during background polls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:39:56 +08:00
dekun 5af0cbf286 Fix chart auto toggle to clearly split follow vs manual zoom.
On tail refresh, auto-on always snaps to latest candles while auto-off preserves the saved viewport with clamped range restore.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:35:56 +08:00
dekun bae78d8368 Respect manual chart zoom when auto-follow is off.
Tie the market auto toggle to both price scale and viewport: tail refresh updates data silently while preserving zoom/pan when auto is disabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:30:44 +08:00
dekun c8ffc764e1 Increase default chart initial bar counts per timeframe.
Load 2000 bars for 1m/5m/15m, 1000 for 1h/2h/4h, and 500 for 1d/1w on first screen instead of 300-bar chunked defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:23:43 +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 7ea51818f1 Fix chart viewport hiding after timeframe switch.
Use pendingViewportEpoch so tail refresh applies default range on new timeframe instead of reusing the previous period's saved range.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:12:33 +08:00
dekun c2203abfa8 Preserve chart zoom and pan across tail refresh updates.
Keep the user viewport when SSE updates candles so zooming out to see the full series is not reset to the recent 200-bar view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:06:57 +08:00
dekun 3ac854d74c Remove 12h timeframe and stabilize chart wheel zoom.
Drop 12h from market chart options and storage, and avoid left-pan reload and tail refresh from resetting the viewport while zooming.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:54:37 +08:00
dekun 4afea6bb97 Fix chart tail viewport after 5m/15m timeframe switches.
Snap to latest candles on period change and only preserve scroll position when viewing history.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:46:14 +08:00
dekun 06897c59f1 Fix market chart viewport jump when switching timeframes.
Reset visible range and block stale left-pan/tail refresh from applying the previous period logical range to new candles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:40:45 +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 41bdee2416 fix(hub): green open arrows for long, red for short on archive chart
Explicit open marker colors and broader direction parsing (short/空/sell).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 23:43:21 +08:00
dekun 69f554214c feat(hub): auto-mark all archive trades on chart
Add 自动 toggle on archive chart; when on, load history span for all trades and plot numbered open/close arrows for each.

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