Records were still in the database but CSS clipping hid row text; restore visible summary styling and symbol fallback from snapshots.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Gate_bot insert_trade_record lacked entry_reason, causing _finalize_plan to save strategy snapshots but fail trade insert. Filter kwargs by signature, insert before plan commit, and add backfill script.
Co-authored-by: Cursor <cursoragent@cursor.com>
Unify display on trend_leg_display_price: use recorded fills or grid triggers only; last done row avg comes from live entry, never back-solve trigger prices.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Gate build_gate_order_params returns {} which is falsy; params or None broke trend_market_add with NoneType is not iterable while first-leg place_exchange_order worked.
Co-authored-by: Cursor <cursoragent@cursor.com>
Log poll exceptions, diagnose live-trading and mark-price blocks on the trend page, start background monitors on app import, and add /api/trend_poll_status for debugging.
Co-authored-by: Cursor <cursoragent@cursor.com>
Poll trend plans with mark price (same as UI) instead of ticker last, add get_symbol_mark_price to gate_bot, tolerate position API blips, and log DCA order failures.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
- Extract shared gate_transfer_lib and global transfer form on all pages
- Block auto-transfer when trend pullback plans have open positions
- Redirect manual transfer back to the current page after submit
Co-authored-by: Cursor <cursoragent@cursor.com>
- 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>
- 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>
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>
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>
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>
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>
Trend pullback plans manage positions before order_monitors handoff; treat them as covered and add a pre-deploy DB backup script.
Co-authored-by: Cursor <cursoragent@cursor.com>