Backtest a rule over a parameter grid, validated
backtest_strategyTest a rule across a parameter grid on your prices, then validate the best result using variants-run count, deflated Sharpe, overfitting probability, track-record length, costs, and buy-and-hold.
Instructions
Backtest a rule on your prices over a whole parameter grid, then validate the best with the count of variants actually run: deflated Sharpe, overfitting probability, minimum track record, vs buy and hold, after costs. A backtest, deflated or not, is not a forecast and not advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grid | No | Values per parameter, e.g. {"fast":[10,20],"slow":[50,200]}; every valid combination runs (max 200). | |
| dates | No | Optional ISO dates, one per value. | |
| family | Yes | sma_cross (fast, slow), momentum (lookback, skip), mean_reversion (window, entry_z), breakout (lookback), buy_and_hold. | |
| prices | No | Prices, oldest first. | |
| cost_bps | No | Cost per unit of turnover, bps; default 5. | |
| allow_short | No | Short instead of flat; default false. | |
| prices_file | No | CSV or JSON of prices on this machine; local server only. | |
| prices_column | No | Column name or 1-based position. | |
| periods_per_year | No | 252 daily (default), 365 crypto, 52 weekly, 12 monthly. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limits | No | ||
| source | No | ||
| selected | No | ||
| variants | No | ||
| validation | No | ||
| buy_and_hold | No | ||
| plain_reading | No |