Run backtest
run_backtestRuns a deterministic backtest from a JSON spec (universe, start, end, signal, rebalance, top_n, costs_bps, side='long'|'long_short', blind=true to hide tickers). universe: a list of symbols, or 'top500'|'top1000'|'top3000'|'all' for the liquid US market (each month the N most-traded names priced >= min_price, default $5, by 63-day dollar volume; 'all' = liquid_top names, default 1000, max 3000; delisted names included while they traded; membership is set on each month's last trading day and used from the next). rebalance: D|W|M|Q (or daily/weekly/monthly/quarterly). signal.type: momentum (lookback, skip days), ma_cross, factor, or expr with signal.expr a formula over close prices, e.g. 'rank(ret(252)) - rank(vol(60))' (functions: ret, logret, sma, ema, vol, rsi, high, low, dist_high, lag, rank, zscore, demean, abs, log, sign, clip, min, max, where). Every result includes 'overfitting': trials counted per API key and the deflated Sharpe ratio. Prices are fetched point-in-time with a 400-trading-day lookback buffer and clipped to as_of, so results have no look-ahead. Identical specs on the same snapshot are cached and free. Returns stats, benchmark stats, equity curve, warnings, snapshot id and a disclaimer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | Backtest spec. | |
| as_of | No | Point-in-time cutoff (YYYY-MM-DD). Nothing dated after this is returned, preventing look-ahead bias. Defaults to today (UTC). |