Skip to content

Commit f823991

Browse files
committed
docs(readme): show vector/event backtest -> report workflow
Add a 'From backtest results to a report' subsection under 'Backtest Analysis & Dashboard' demonstrating the canonical paths from a Backtest (or list of Backtests) to a BacktestReport: - single event-driven app.run_backtest(...) - a sweep via app.run_vector_backtests(..., backtest_storage_directory=...) - loading a persisted folder back via BacktestReport.open(directory_path=..., workers=-1) Cross-links to the Backtest Storage Layer section for sweeps that scale into the thousands.
1 parent c6cce6a commit f823991

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,38 @@ Every backtest produces a **self-contained HTML dashboard** — open it in any b
142142
- **Built-in MCP server** — let Copilot, Claude, or any MCP-compatible agent query your backtests, rank strategies, and reason over trades through `investing-algorithm-framework mcp`
143143
- **Notes keeping** — annotate every backtest with hypotheses, observations and conclusions; notes travel with the report so your research is never lost
144144

145+
#### From backtest results to a report
146+
147+
Every backtest API — vector or event-driven — returns the same `Backtest` object, which the `BacktestReport` consumes directly. So whether you're iterating over an in-memory list or a folder of persisted `.iafbt` bundles, the path to the dashboard is the same:
148+
149+
```python
150+
from investing_algorithm_framework import BacktestReport
151+
152+
# --- Single event-driven backtest ---
153+
backtest = app.run_backtest(backtest_date_range=date_range)
154+
BacktestReport(backtests=[backtest]).save("event_report.html")
155+
156+
# --- A sweep of vector backtests (parameter grid / multi-window) ---
157+
backtests = app.run_vector_backtests(
158+
strategies=[StrategyA(), StrategyB(), StrategyC()],
159+
backtest_date_ranges=[range_2022, range_2023, range_2024],
160+
n_workers=-1,
161+
backtest_storage_directory="./my-backtests/", # persists .iafbt bundles
162+
show_progress=True,
163+
)
164+
BacktestReport(backtests=backtests).save("sweep_report.html")
165+
166+
# --- Or: load a folder of bundles back later (parallel decode) ---
167+
report = BacktestReport.open(
168+
directory_path="./my-backtests/",
169+
workers=-1,
170+
show_progress=True,
171+
)
172+
report.save("from_disk_report.html")
173+
```
174+
175+
For sweeps that grow into the thousands, combine this with the [Backtest Storage Layer](examples/storage_layer_demo/README.md) below — rank in SQLite first, then load only the winners into the report.
176+
145177
[Backtest dashboard docs](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtesting) · [MCP server docs](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/mcp-server)
146178

147179
</details>

0 commit comments

Comments
 (0)