fix: VBT dashboard — proper metrics display + redesigned UI

- Fixed total_return_pct, profit_factor, n_bars showing 0 in detail view
  by using ?? operator instead of || 0 and fixing renderDetail logic
- Run Backtest now renders result directly from API response
  (no re-fetch race condition)
- Redesigned UI: monospace trading terminal aesthetic
  - Darker palette (#090d14 background, #0d1321 cards)
  - Indigo histogram, proper grid layout
  - Subtle borders (1px #1a2332), better spacing
  - Status indicator with pulse animation
  - Sidebar shows Sharpe, Return%, Profit Factor per result
  - 8 metric cards: Return, Sharpe, DD, Win Rate, PF, Trades,
    End Equity, Sortino
  - Smaller, cleaner fonts, monospace throughout
- Bumped memory guard to 2GB to prevent dashboard getting killed
This commit is contained in:
ramseshk
2026-08-07 12:31:24 +08:00
parent 3606e7f92e
commit 737b24895c
2 changed files with 149 additions and 155 deletions
+3 -3
View File
@@ -44,9 +44,9 @@ from strategies.quant_report import compute_quant_report
# ═══════════════════════════════════════════════════════════
import gc, os as _os
MEM_SOFT_LIMIT = 256 * 1024 * 1024 # 256 MB — force GC
MEM_WARN_LIMIT = 384 * 1024 * 1024 # 384 MB — log warning
MEM_HARD_LIMIT = 512 * 1024 * 1024 # 512 MB — terminate
MEM_SOFT_LIMIT = 512 * 1024 * 1024 # 512 MB — force GC
MEM_WARN_LIMIT = 768 * 1024 * 1024 # 768 MB — log warning
MEM_HARD_LIMIT = 2048 * 1024 * 1024 # 2 GB — terminate
def check_memory():
"""Check RSS, force GC if over soft limit, raise if over hard limit."""