feat: add 5 dashboard features — dark mode, trade history, backtests, model insights, alerts

- Dark mode: class-based theme toggle with localStorage persistence and flash prevention
- Trade History (/trades): paginated table, stats cards, equity curve chart with DB API endpoints
- Backtest Viewer (/backtests): log parser for 35 backtest results, sidebar + detail + comparison tabs
- Model Insights: dashboard card + dialog showing feature importance, regime distribution, training history
- Alert/Signal Log (/alerts): signal stats, filterable table with execution tracking
- API: 8 new endpoints with psycopg2 DB connection pool
- Dark mode sweep across books page, about dialog, and all dashboard components
- Architecture docs rewritten with Mermaid diagrams (23 docs)
- README and FEATURES.md rewritten bilingual (Indonesian + English)
- main_live.py: write model_metrics.json on startup and retrain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
GifariKemal
2026-02-09 05:46:54 +07:00
co-authored by Claude Opus 4.6
parent b2dc2dacd7
commit e8355b3f62
230 changed files with 69573 additions and 5673 deletions
@@ -0,0 +1,31 @@
#35 Fix S/L Bug Results
Generated: 2026-02-08 18:45:06.641730
Bug: hours_to_golden NameError in Check 5 max loss
Fix: Remove golden hold pass-through, close immediately at threshold
=== RESULTS ===
Baseline: #34A (golden hold): 614 trades, 82.6% WR, $3,162.64, DD: 2.4%, Sharpe: 4.41, PF: 2.43, MaxLoss exits: 24, vs Base: $+0.00
A: Fix S/L 50% (no hold): 614 trades, 82.6% WR, $3,162.64, DD: 2.4%, Sharpe: 4.41, PF: 2.43, MaxLoss exits: 24, vs Base: $+0.00
B: Fix S/L 40% (tighter): 617 trades, 81.8% WR, $2,859.53, DD: 2.1%, Sharpe: 4.14, PF: 2.24, MaxLoss exits: 32, vs Base: $-303.11
C: Fix S/L 60% (looser): 614 trades, 82.9% WR, $3,176.05, DD: 2.4%, Sharpe: 4.29, PF: 2.39, MaxLoss exits: 17, vs Base: $+13.42
Best: C: Fix S/L 60% (looser)
=== MAX-LOSS EXIT ANALYSIS ===
Baseline: #34A (golden hold): 24 exits, avg $-37.38, worst $-76.63
A: Fix S/L 50% (no hold): 24 exits, avg $-37.38, worst $-76.63
B: Fix S/L 40% (tighter): 32 exits, avg $-32.87, worst $-76.63
C: Fix S/L 60% (looser): 17 exits, avg $-44.61, worst $-76.63
=== EXIT REASONS (BEST) ===
trailing_sl : 297 (48.4%)
breakeven_exit : 161 (26.2%)
early_cut : 45 (7.3%)
take_profit : 28 (4.6%)
trend_reversal : 26 (4.2%)
smart_tp : 19 (3.1%)
max_loss : 17 (2.8%)
weekend_close : 9 (1.5%)
timeout : 7 (1.1%)
peak_protect : 4 (0.7%)
market_signal : 1 (0.2%)