Run backtest
backtestReplay a trading strategy over historical price snapshots on synthetic order books to evaluate performance without touching paper accounts.
Instructions
Replay a strategy over historical price snapshots on synthetic order books.
Reads the data file and returns performance metrics; it does not touch your paper accounts. Use pk_battle to compare two strategies live, or stats for an account's real results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Synthetic order-book size in shares at each price level. Default 500. | |
| spread | No | Synthetic order-book spread as a price fraction (0.02 = 2 cents). Default 0.02. | |
| balance | No | Starting USD balance. Default 10000. | |
| data_path | Yes | Path to a CSV or JSON file of price snapshots (timestamp, market_slug, outcome, midpoint); must be under the home directory or /tmp. | |
| strategy_path | Yes | Dotted Python path of the strategy function, e.g. 'examples.momentum.run'; only 'examples.' modules are allowed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |