Commit Graph

262 Commits

Author SHA1 Message Date
dekun 3f1bf9905d fix: AI review list UTC filter, vision timeout, and stuck loading state
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:59:17 +08:00
dekun 4ac4c062e0 fix: AI review loading UX and Gate preview snapshot time filter SQL
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:51:16 +08:00
dekun 86a6081090 fix: AI daily review sqlite3.Row crash and error feedback across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:39:50 +08:00
dekun 995ee8d2e1 fix: prevent theme flash when navigating instance pages from hub iframe
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:23:51 +08:00
dekun e30d24173f fix(ui): light-theme badges, PnL colors, and journal detail across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:16:29 +08:00
dekun 1b51f73ecd fix: journal detail contrast and unify AI review journal format across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:09:59 +08:00
dekun 934e48b9a8 fix: show risk amount only in full-margin mode across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 09:08:45 +08:00
dekun 673bcbdc70 fix: align unrealized PnL across four exchange instances via hub_position_metrics
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:25:06 +08:00
dekun 806350231e fix(hub): show contract-based unrealized PnL in monitor and chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:20:36 +08:00
dekun ef8656e95d fix(hub): define mo in buildPositionMarketContext
Fixes monitor grid crash ReferenceError mo is not defined when opening market from position card.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:15:10 +08:00
dekun fb20a12b02 fix(hub): show monitor page instead of overlapping market page
page-market id contained substring monitor so setActiveNav kept both pages visible and hid the grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:13:03 +08:00
dekun c9ca106b81 fix(hub): recalc market floating PnL from live chart mark
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>
2026-06-04 20:09:35 +08:00
dekun e6361a7fcc fix(hub): live market PnL and Gate drag SL place
Parse Gate unrealised_pnl in agent; refresh hub market floating PnL from board and trends; clamp Gate TP/SL triggers before place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:02:23 +08:00
dekun 24270944e7 fix(hub,gate): cross-margin TP/SL and dedupe hub conditional orders
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>
2026-06-04 19:48:04 +08:00
dekun ed0805538f fix(hub): sync TP/SL display after trend handoff to order monitor
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>
2026-06-04 19:39:11 +08:00
dekun e39fac2c16 feat(hub): show floating PnL on market page and drag stop-loss to place TP/SL
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>
2026-06-04 19:31:45 +08:00
dekun 93e148a3e7 fix: unify order/key focus K-line theme, PnL, RR and exchange price tick
Share focus_chart templates and APIs across four instances; align chart Y-axis, price lines and meta bar with exchange symbol precision and live unrealized PnL.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 16:45:51 +08:00
dekun 3d55aa0975 fix(gate-bot): format mark price with exchange symbol precision
Use price_to_precision in price_snapshot so live mark price matches entry/SL display instead of fixed 8 decimals.
2026-06-04 16:33:09 +08:00
dekun 88fc21e278 fix(gate-bot): allow profit-side stop loss on TP/SL entrust
Skip min planned RR when stop is on the winning side of entry; validate entrust against open price and fall back to plan take-profit when omitted.
2026-06-04 16:28:47 +08:00
dekun 1042f135ed fix(gate-bot): PnL colors, sync exchange TP/SL to plan display
Color floating PnL on position cards, mirror exchange stop/take prices in the grid and DB, and purge false external-close records on monitor relink.
2026-06-04 16:23:52 +08:00
dekun 1618ef8668 fix(gate-bot): show orphan exchange positions and relink monitor
When the exchange still has a position but order_monitors is not active, surface it on the trade page and allow restoring the latest stopped record.
2026-06-04 16:17:34 +08:00
dekun e327f1b1fb feat(gate-bot): align order monitor with Gate main site
Dual-panel trade UI, exchange TP/SL entrust modal, and place/cancel_tpsl APIs so bot manual trading matches Gate.
2026-06-04 16:09:17 +08:00
dekun f9301b92b9 feat(hub): trend plan breakeven and stop from monitor fullscreen
Proxy /api/hub/trend/stop and breakeven to instances; enable offset input and actions in hub UI. Add horizontal padding on strategy records page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 14:46:24 +08:00
dekun 52d97482f2 feat(strategy): WeChat notify on trend and roll plan start/end
Add shared strategy_wechat_notify helpers; hook trend execute/finalize and roll group open/close across four exchanges and Gate bot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 13:35:21 +08:00
dekun 3b4120a36e fix(instance): light-theme journal AI buttons and mood checkboxes
Fix secondary button contrast, exclude checkboxes from dark input fill, style mood-grid; bump theme assets to v4.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 13:12:44 +08:00
dekun 21b3e97571 fix(instance): light-theme P/L colors, AI review panels, bot stats
Restore plan floating P/L and st-done greens; fix panel-item and stats-split-col in light mode; observe journal lists; bump theme assets to v3.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 13:07:00 +08:00
dekun be3ce18665 style(instance): unify light theme across four exchanges
Extend instance_theme CSS/JS for trade, strategy, records, journal and stats tabs; remap inline dark colors; bump static assets to v2.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:59:42 +08:00
dekun d14c629778 feat: add light/dark theme to exchange instances with hub SSO sync
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:52:27 +08:00
dekun 6f8f0968c8 feat(hub): background chart poll with SSE for positions and market watch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:39:26 +08:00
dekun 9d12323ce6 style(hub): fix light-theme load button and market position panel colors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:14:48 +08:00
dekun e99c6cef08 style(hub): refine light theme contrast and theme-aware fullscreen UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:08:35 +08:00
dekun d1914df46f feat(hub): add dark/light theme toggle with moon and sun icons
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:03:48 +08:00
dekun b394e495ca chore: remove instance Windows scripts and screen/systemd helpers
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:56:32 +08:00
dekun 4569e070fd chore: remove Windows deployment scripts and update hub usage examples
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:53:42 +08:00
dekun 1282293e91 docs: unify Ubuntu root /opt PM2 deployment and refresh README
Add docs/ubuntu-server.md; remove Windows and alternate process managers from deployment guides; index strategy, key monitor, TP/SL, breakeven, and replay docs in root README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:48:54 +08:00
dekun 546bc7bcf1 fix(hub): two-column trend plan card; docs for records and hub layout
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>
2026-06-04 10:59:47 +08:00
dekun f1e95afb89 feat: strategy records dual panels with filters and 100-row cap
Split trend and roll snapshot lists with expandable rows, client filters, and DB prune to latest 100 entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:55:34 +08:00
dekun 7037dc2334 fix(hub): align trend pullback card with instance layout
Match strategy page plan card: 3x3 metrics, DCA table, breakeven row, snapshot footer; PnL percent on plan margin.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:51:13 +08:00
dekun 3fb2023efb feat: strategy trade snapshots, DCA detail, and hub trend layout
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>
2026-06-04 10:45:27 +08:00
dekun 1a6b5f55a1 fix: regenerate clean app icons with Pillow (fix corrupted favicon)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:22:08 +08:00
dekun e03cce20d6 feat: add brand icons for Chrome shortcuts and PWA manifest
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>
2026-06-04 10:17:22 +08:00
dekun ed669fab80 fix(hub): show trend plan leverage, base, ratio, mark and floating PnL
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>
2026-06-04 10:13:44 +08:00
dekun 98c904c2d1 feat(hub): align trend pullback display with instance in fullscreen
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>
2026-06-04 10:09:04 +08:00
dekun 02bc3c14bc docs: document four-exchange env sync script usage
Add docs/env-sync-scripts.md; cross-link from deploy README, feature docs, README, and script headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:02:08 +08:00
dekun 5e694ff795 docs: reference unified env sync script in position-sizing guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:59:53 +08:00
dekun e6e79215fc chore: add unified four-exchange env sync scripts
sync_four_exchange_env runs position sizing + transfer sync; transfer script preserves existing values and supports --set-amount/--enable-auto-transfer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:59:33 +08:00
dekun 29b0634c6d feat: bidirectional daily auto-transfer with position skip
Rebalance swap to AUTO_TRANSFER_AMOUNT at Beijing hour: top up from funding or sweep excess back. Skip and WeChat notify when active positions exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:57:25 +08:00
dekun 0456d5fa2c chore: add script to sync position sizing env across four exchanges
sync_four_exchange_position_sizing_env.py appends missing POSITION_SIZING_MODE and FULL_MARGIN_BUFFER_RATIO, optional --set-mode/--set-buffer; docs updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:30:44 +08:00
dekun f7bac11694 feat: add full-margin position sizing mode across four exchanges
Env POSITION_SIZING_MODE switches risk vs full-margin (available*buffer, BTC/ETH 10x). Blocks trend/roll/key auto opens in full margin, purges breakout/fib monitors with WeChat notice, keeps RR check and initial SL snapshot for records.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:24:35 +08:00
dekun d75527a9ca docs(env): unify auto-transfer config across four exchanges
Align .env.example blocks and add sync script to merge AUTO_TRANSFER_* into existing instance .env files without touching API secrets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 07:47:18 +08:00