Commit Graph

402 Commits

Author SHA1 Message Date
dekun 6eb17b7ddc feat: add trading day split lines on hub market chart
Add toggle before technical indicators to show blue dashed vertical lines at Beijing 8:00 day boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 08:35:35 +08:00
dekun b6d343a951 sync gate_bot with gate as identical copy instance
Align gate_bot app, templates, and env template with gate while keeping bot identity (port 5002, hub key gate_bot).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:19:50 +08:00
dekun 59a45ed027 fix: Gate hub close sync and trade record open stop-loss snapshot
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>
2026-06-09 18:01:59 +08:00
dekun 02d2a6c70b fix: mobile hub AI keyboard layout and instance top nav scroll
Sync hub shell to visualViewport when the keyboard opens to prevent white screen above chat input. Make instance tabs horizontally scrollable with active tab centered on phone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 17:16:00 +08:00
dekun 9aba8ec645 feat: hide instance export and stats on mobile, desktop-only downloads
Mark export bar and summary stat cards as instance-desktop-only. Hide all CSV/MD export actions on phone across four exchange instances.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 17:07:00 +08:00
dekun e60beeedd3 feat: fix mobile AI full-width layout and simplify instance stats
Move hub AI mobile CSS after desktop grid rules so chat fills the screen. Hide exchange and total-trade stat cards on phone across all instances and compact export bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:57:47 +08:00
dekun ea3ef71477 feat: optimize hub mobile layout with chat-first AI coach tabs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:47:19 +08:00
dekun 3527c26717 feat: collapse trade/strategy rule tips and color-code key history outcomes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:39:36 +08:00
dekun 04d5d5329e feat: show pending key monitor orders in green on summary line
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:26:07 +08:00
dekun 77aef229e9 fix: show full key history alert when expanded in scroll panel
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:22:46 +08:00
dekun 4a043e65e3 feat: improve light mode key monitor UI and collapse rule tips by default
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:18:10 +08:00
dekun 260828041f feat: unify key monitor UI with one-line summary and expandable details across all exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:11:31 +08:00
dekun 24a86a710c feat: add per-account daily open hard limit across all exchanges
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>
2026-06-09 15:46:18 +08:00
dekun f7d94f67d7 fix: sync live TP/SL to position cards after entrust changes
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>
2026-06-09 11:06:27 +08:00
dekun 7cb55f6557 feat: add false breakout key monitor for BTC/ETH on three exchanges
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>
2026-06-09 10:13:53 +08:00
dekun 2786acf884 fix: feed today-only data to AI daily summary to reduce hallucination
Shrink summary context and prompts to today's trades and positions only, and tighten anti-fabrication rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 09:39:40 +08:00
dekun a5c6e0c5b6 feat: add fixed RR stop-loss mode for manual live orders on all instances
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 20:57:29 +08:00
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 1dcf62bb08 fix: align OHLCV fetch window with limit so chart seeds past 30 bars
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:37:00 +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 e71bfe095c Prevent duplicate strategy trade snapshots on plan close.
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>
2026-06-08 09:00:51 +08:00
dekun ea92160d54 Fix strategy records list showing empty rows after hub close.
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>
2026-06-08 08:51:47 +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 63472719ec Fetch native exchange OHLCV per timeframe instead of local aggregation.
Store and serve 15m/2h/4h directly from the exchange so market charts match venue candles.

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