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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>