- 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
- signal_indicators table: added strategy column
- Each strategy gets its own row per cycle
- API /api/signals/latest?strategy=v51_baseline|v52_8signals
- API /api/signals/signal-history?strategy=...
- V5.1 page reads v51_baseline data, V5.2 reads v52_8signals
- Now V5.1 and V5.2 show truly independent scores
- /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
Removed USD threshold gates. Now any liquidation data triggers scoring:
- ratio ≥ 2.0 → +5 (extreme imbalance)
- ratio ≥ 1.5 → +3
- ratio ≥ 1.2 → +1
- ratio 0.8~1.2 → 0 (balanced)
- Inverse for SHORT direction
- Each strategy has its own position count (max 4 each)
- paper_config.enabled_strategies: per-strategy toggle
- is_strategy_enabled() checks both master switch and strategy list
- API: /api/paper/config now supports enabled_strategies array
- Config auto-loads on API startup
Usage: POST /api/paper/config {enabled_strategies: ['v52_8signals']}
- 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
- TP/SL now exit at order price (limit order), not market price
- SL exits at sl_price, TP1 at tp1_price, TP2 at tp2_price
- Only timeout and signal_flip use market price (current price)
- Updated fix_historical_pnl.py to also correct exit_price
- This eliminates fake slippage in paper trading stats
P0-1: Reverse signal now bypasses cooldown - evaluate_signal always
outputs direction, main loop checks direction+score>=60 for
closing positions against trend (not blocked by COOLDOWN_MS)
P0-2: pnl_r unified to (exit-entry)/risk_distance across all exit
scenarios (tp, sl, sl_be, timeout) in both paper_monitor.py
and signal_engine.py. Old hardcoded values (1.5R/2.25R) were
~2x too high vs actual risk_distance basis.
P1-1: ensure_partitions month calculation fixed from timedelta(30d)
to proper month arithmetic. Also fixed UTC timezone for
partition boundaries.
docs: V52-TODO.md with full audit backlog for V5.2
- auth.py: rewrite to use PG via db.py (was sqlite3)
- admin_cli.py: rewrite to use PG
- migrate_auth_sqlite_to_pg.py: one-time migration script
- SQLite arb.db no longer needed after migration