Force exchange_key on archive sync; add contract column and tag select styles on inner-light-mind; serve time_close_ui.js on instances so order/key time-close duration can be selected.
Co-authored-by: Cursor <cursoragent@cursor.com>
False breakout used box/convergence volume/break gates in the UI; now shows pending limit order status like fib monitors.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add HUB_FUND_HISTORY_START_DAY so curves and drawdown exclude snapshots before the baseline trading day.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Sync order monitors from Gate position history after hub flat close. Store and display initial_stop_loss in trade records instead of post-amend exchange stops.
Co-authored-by: Cursor <cursoragent@cursor.com>
Enforce optional DAILY_OPEN_HARD_LIMIT in precheck_risk and can_trade, keep AI alerts at DAILY_OPEN_ALERT_THRESHOLD, and document env setup for all four instances.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Place limit orders outside key levels with fixed SL and 1.5 RR, 24h expiry, separate stats, and full-margin mode guard.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
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>
Finalize plans before writing snapshots, dedupe on startup and page load, and add a cleanup script for existing repeated rows.
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>
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>
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>
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>
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>
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>