Commit Graph

25 Commits

Author SHA1 Message Date
dev-worker
8bd5f8fa84 fix: 模拟盘前端ActivePositions组件自行fetch config计算paper1R 2026-03-02 17:37:03 +00:00
dev-worker
31e6e19ea6 fix: V3全面审阅修复 — 12项问题
P0-1: 风控Fail-Closed(状态文件缺失/过期/异常→拒绝开仓)
P0-2: 1R基准跨模块统一(position_sync+risk_guard从live_config动态读)
P0-3: close_all紧急全平校验返回值+二次验仓
P0-4: Coinbase Premium单位修复(premium_pct/100→比例值)
P1-3: 正向funding计入净PnL(不再只扣负值)
P1-4: 数据新鲜度检查落地(查signal_indicators最新ts)
P1-6: live表DDL补全到SCHEMA_SQL(live_config/live_events/live_trades)
P2-1: _get_risk_usd()加60秒缓存
P2-3: 模拟盘前端*200→从config动态算paper1R
P2-4: XRP/SOL跳过Coinbase Premium采集(无数据源)
P3-2: SQL参数化(fetch_pending_signals用ANY替代f-string)
额外: pnl_r公式修正(gross-fee+funding,funding正负都正确计入)
2026-03-02 17:28:23 +00:00
root
a7dec3fe14 fix: frontend use DB risk_distance + add entry time with ms
- Both paper pages now read risk_distance from API (not hardcoded 2.0*0.7*ATR)
- Added entry timestamp display (精确到毫秒) in active positions
- Applies to both V5.1 and V5.2 paper pages
2026-03-02 07:13:52 +00:00
root
984019d9ab fix: paper latest signals use signal-history with strategy filter + layer scores
- V5.1 paper: signal-history?strategy=v51_baseline
- V5.2 paper: signal-history?strategy=v52_8signals
- API now returns factors in signal-history
- Each signal shows layer score badges below
2026-03-02 03:08:19 +00:00
root
5b704a0a0e feat: paper pages show per-strategy signals with layer scores
- V5.1 paper reads /api/signals/latest?strategy=v51_baseline
- V5.2 paper reads /api/signals/latest?strategy=v52_8signals
- Each coin shows layer score badges (方向/拥挤/环境/确认/辅助)
- V5.2 additionally shows FR and 清算 badges
2026-03-02 02:59:39 +00:00
root
5849bf6522 refactor: completely separate V5.1 and V5.2 pages
- /signals: V5.1 ONLY, 5-layer scoring, no FR/Liq
- /signals-v52: V5.2 ONLY, 7-layer scoring with FR/Liq
- /paper: V5.1 ONLY, no strategy tabs/badges
- /paper-v52: V5.2 ONLY, with FR/Liq display
- Sidebar: V5.1 and V5.2 separate sections
- V5.2 weights: 40+18+5+12+15+5+5=100 (no more >100)
- Zero cross-contamination between V5.1 and V5.2
2026-03-02 00:25:07 +00:00
root
ec198db504 fix: always show FR/Liq scores for V5.2 trades in history 2026-03-01 23:18:48 +00:00
root
7d2bb9f392 fix: FR/Liq scoring bugs + compact UI
Backend:
- FR threshold: 0.001→0.0003 (extreme), 0.0003→0.00005 (moderate)
- Liquidation SQL: side='SELL'/'BUY' → 'LONG'/'SHORT' (was never matching!)

Frontend:
- FR/Liq scores now inline in score column (compact)
- Removed bulky green badge buttons from position cards
2026-03-01 23:14:07 +00:00
root
ee90b8dcfa feat: sidebar navigation with V5.1/V5.2 separate entries
- Sidebar: 信号/模拟盘 section headers
- Three paper trade entries: 全部持仓, V5.1模拟盘, V5.2模拟盘 (NEW badge)
- Paper page reads strategy from URL query params
- Suspense boundary for useSearchParams
2026-03-01 12:25:40 +00:00
root
778cf8cce1 feat: V5.2 frontend differentiation - strategy tabs, side-by-side scores, visual badges
- Paper page: prominent strategy tabs (全部/V5.1/V5.2) at top
- Paper trades: strategy column with color-coded badges (blue=V5.1, green=V5.2)
- Paper positions: FR/Liq scores displayed prominently for V5.2
- Signals page: side-by-side V5.1 vs V5.2 score comparison cards
- Signals page title updated to 'V5.1 vs V5.2'
- New API endpoint for strategy comparison data
- Layout: local font fallback for build stability
2026-03-01 12:21:19 +00:00
root
7ba53a5005 Update paper UI for strategy filters and FR/liquidation details 2026-03-01 11:55:03 +00:00
root
4b841bc5f4 fix: floating PnL now accounts for half-position after TP1
Before: unrealR = full position × price move (wrong after TP1)
After: unrealR = 0.5×TP1_locked + 0.5×current_float (correct)

This fixes the display showing >1R floating profit that never
materializes in final PnL because only half position remains.
2026-03-01 09:48:46 +00:00
root
bda42e669a feat: stats panel with per-symbol tabs (ALL/BTC/ETH/XRP/SOL) - full stats for each coin 2026-03-01 01:37:02 +00:00
root
404cc683e0 fix: latest signals pass symbol without USDT suffix to signal-history API 2026-02-28 13:31:14 +00:00
root
71192d4209 fix: latest signals use signal-history API (last triggered signal, not realtime eval) 2026-02-28 13:20:24 +00:00
root
374615dea7 feat: paper page show latest signal per coin 2026-02-28 12:45:47 +00:00
root
95fec35d97 fix: paper balance font-size auto-fit (text-base instead of text-lg) 2026-02-28 12:38:52 +00:00
root
1d2304261b feat: paper frontend use aggTrade WS for real-time price (every tick instead of 1s) 2026-02-28 12:30:11 +00:00
root
d0e626a437 feat: paper summary add balance + pnl_usdt 2026-02-28 12:00:19 +00:00
root
7b901a2390 feat: paper_monitor.py - WebSocket realtime TP/SL + frontend WS price feed (1s update) 2026-02-28 11:55:40 +00:00
root
66810701fb feat: paper trading signal flip - reverse signal closes existing position then opens new 2026-02-28 11:45:48 +00:00
root
f90df6f3b5 feat: paper positions show real-time price + unrealized PnL (R + USDT) 2026-02-28 11:40:11 +00:00
root
59910fe9cd fix: paper page use useAuth() instead of manual localStorage check 2026-02-28 11:24:29 +00:00
root
282aed138a feat: paper trading switch + config API + max positions limit 2026-02-28 11:13:39 +00:00
root
e054db112d feat: paper trading - backend (table+signal_engine integration+5 APIs) + frontend page 2026-02-28 11:10:28 +00:00