backtest
Run strategy simulations on local CSV/BIN bar data, configure capital, costs, and date ranges, then return performance metrics and a run ID for trade inspection.
Instructions
Run a Reamer Research backtest.
strategy_file: path to a Python file defining on_bar(data) as a function, a class or an object (see api_reference). Relative paths resolve against the server's working directory. data: a .csv or .bin path, a list of them, or {ticker: path}. A ticker is named after its file. strategy_name: which global in the file to run, when it defines several. lookback: bars per on_bar window; defaults to the strategy's lookback, else 1. start, end: epoch seconds UTC, inclusive; only bars in that range run. settings: rr.backtest settings such as initial_capital, commission_per_unit, spread, slippage, price_volatility, leverage, rng_seed. Costs default to 0. ticker_config: {ticker: {setting: value}} where one ticker's costs differ.
Returns the summary metrics and a run_id for closed_trades, monte_carlo, printed_output and open_trade_diagnostics.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"strategy_file": "<strategy_file>",
"data": "<data>"
},
"name": "backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| data | Yes | ||
| start | No | ||
| lookback | No | ||
| settings | No | ||
| timeout_s | No | ||
| strategy_file | Yes | ||
| strategy_name | No | ||
| ticker_config | No |