Skip to content

Backtest Lab — overview

The Lab turns a single backtest into research — Compare, Sweep, and Walk-forward modes over a shared base configuration, all running client-side in a worker pool.

The Backtest Lab is where one backtest becomes an experiment. You set a base configuration once, then explore it three ways:

  • Compare — run several variants side by side; overlaid equity curves + a metrics diff table.
  • Sweep — vary one or two numeric parameters over a grid; read the outcome as a heatmap.
  • Walk-forward — roll train/test windows forward to check out-of-sample robustness.

The base configuration

Every mode starts from the same base BacktestConfig: symbols, dates, strategy, optimizer, and the numeric parameters (topN, rebalanceFreq, t, window, risk-free rate, costs). Compare varies it by hand; Sweep and Walk-forward vary it mechanically.

How the Lab runs many backtests

The Lab executes runs through a client-side worker pool — the same engine as a single backtest, parallelized across Web Workers. Nothing is sent to a server. Failed runs are handled gracefully: in Compare a failed variant is skipped but keeps its color/label slot, and in Sweep a failed cell degrades to a blank rather than aborting the grid.

When to use which mode

You want to…Use
See if idea A beats idea B (and the benchmark)Compare
Find the best t / topN / rebalanceFreq / windowSweep
Know whether the “best” params hold up out-of-sampleWalk-forward

A healthy workflow chains them: Sweep to find promising parameters, Walk-forward to check they aren’t overfit, Compare to pit the survivor against baselines like Equal Weight.