backtest_rules
Run historical backtests of trading rules on real market data to evaluate performance, monthly returns, drawdown, turnover, and transaction costs.
Instructions
Run a historical backtest of trading rules on REAL market data — not simulated FLOW paths. Tests how rules would have performed over a historical period. Returns same structure as forward_test_rules (base vs combined vs per-rule attribution) PLUS monthly returns table, drawdown series, turnover stats, and transaction cost analysis. Prerequisites: create rules with create_rule (and activate them). Transaction costs: configurable (default 10bps per trade). Warmup period (default 252 days) pre-fills indicator state before the test period starts. For forward-looking testing on synthetic FLOW paths, use forward_test_rules instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost_bps | No | Transaction cost in basis points per trade (default 10.0) | |
| end_date | No | End date (YYYY-MM-DD). Defaults to latest available data. | |
| rule_ids | No | Specific rule UUIDs. Omit to test all active rules. | |
| start_date | Yes | Backtest start date (YYYY-MM-DD). E.g. '2020-01-01' for a COVID-era test. | |
| warmup_days | No | Days of history before start_date for indicator seeding (default 252 = ~1 year) | |
| portfolio_id | Yes | Portfolio UUID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |