feat: redesign BacktestReport — unified HTML dashboard#420
Merged
Conversation
…dashboard - Replace old Plotly-based report with self-contained HTML dashboard - Jinja2 template with canvas-based charts, zero external dependencies - Separate CSS/JS/HTML template files for maintainability - Multi-strategy comparison: ranking table, equity curves, metric bars - Strategy selection filters equity curves and metric comparison charts - Pagination with Top 5/10/20/50/All for ranking table - Backtest window dropdown to view per-window metrics - Windows page with dedicated backtest window analysis table - System theme detection (prefers-color-scheme) with manual toggle - Overview KPIs: CAGR, Sharpe, Sortino, Calmar, Win Rate, Max DD - Fix _is_backtest() to match actual saved format - Fix tuple unpacking for all time-series data - Add example script and documentation - 23 unit tests for HTML report generation Closes #401
- Add recalculate_backtests() to recompute all per-run and summary metrics from raw portfolio snapshots and trades - Redesign compare page: Key Metrics, Trading Activity, Return Scenarios ranking tables (overview style) - Merge Monthly Returns + Monthly Return Distribution into single component with Returns/Growth x Rows/Heatmap toggles + year filter - Add trades_per_month/week metrics to BacktestMetrics and summary - Add Recovery Factor and Volatility to Key Metrics table - Update backtest-reports.md docs with recalculate_backtests API and updated dashboard feature descriptions - Add test_recalculate_backtests.py with idempotency and consistency tests - Wire recalculate_backtests into examples/open.py
- Restructure README around create → backtest → compare → deploy loop - Add detailed Backtest Report Dashboard section (overview + compare pages) - Shorten strategy example from ~200 lines to ~30 lines - Move sponsor section into header with styled layout - Clean up features table and remove emoji clutter - Fix test tuple order in test_backtest_report_html.py (value, date)
…improvements - Add parameters field to Backtest dataclass (save/open/merge) - Add set_parameters()/get_parameters() to TradingStrategy - Wire parameters through backtest service and report builder - Add Parameters Comparison table on compare page - Add Strategy Parameters card on per-strategy pages - Add Parameters tab in strategy selection modal with chip/range filters - Fix buildCompareParameters to use selectedForCompare - Auto-apply param filters on modal close - Dashboard: metrics fixes, README updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redesign BacktestReport — Unified Single & Multi-Strategy HTML Dashboard
Closes #401
What changed
Replaced the old Plotly-based backtest report with a self-contained HTML dashboard that works for both single-strategy and multi-strategy backtests.
Key features
prefers-color-scheme), manual toggleBug fixes
_is_backtest()now checks foralgorithm_id.json+runs/directory (matches actual saved format)equity_curve,drawdown_series,rolling_sharpe_ratio,monthly_returns,yearly_returns)Files changed
app/reporting/backtest_report.pyapp/reporting/templates/dashboard.cssapp/reporting/templates/dashboard.jsapp/reporting/templates/dashboard_template.html.j2tests/app/reporting/test_backtest_report_html.pyexamples/open.pyREADME.mddocusaurus/docs/Getting Started/backtest-reports.mddocusaurus/docs/Getting Started/backtesting.mddocusaurus/sidebars.jsTesting
examples/open.pyconfirmed dashboard renders correctly