Endpoints · Strategies

Backtest a strategy on a ticker

GET/v2/strategies/{name}/backtest

For strategies with exit policy, this walks bars in order and produces a series of (entry, exit, pnl, exit_reason) records the way a real trading bot would. With no exit policy, the strategy exits when the condition flips false; PnL is null unless `position_size` is supplied. Distinct from /history (per-bar boolean) and /events (condition-true spans). Backtest is the only one of the three that consumes the exit-policy fields.

Plan access

Hobby and above.

Rate limit

Hobby 60/min · Pro 2,000/min · Scale 10,000/min.

Capacity

Counts against your saved-rule capacity until v1.5 introduces a separate cap.

stringrequired

Strategy slug.

stringrequired

Ticker symbol to backtest on.

stringdefault 1d

Bar resolution. Defaults to 1d.

integer

Earliest epoch ms.

integer

Latest epoch ms.

number

Dollars per trade. When supplied, the PnL fields become absolute; otherwise PnL is expressed as percent.

200
{ as_of, ticker, interval, trades: [...], summary: { n_trades, win_rate, total_pnl_pct, total_pnl_abs?, avg_hold_bars } }.