Definition

Walk-forward analysis

Walk-forward analysis fits parameters on one window of history, tests them untouched on the next, then rolls forward. How to read walk-forward efficiency, and how the test gets undone.

Updated

Walk-forward analysis is a backtest procedure that fits the parameters of a strategy on one window of history (in-sample), runs them unchanged on the following window (out-of-sample), then rolls both windows forward and repeats. The stitched out-of-sample segments are the only performance figure that counts; the in-sample results are the cost of choosing the parameters, not evidence. A typical split is twelve months in-sample and three months out-of-sample, rolled quarterly, and a walk-forward efficiency — out-of-sample return divided by in-sample return — below roughly 0.5 says the parameters are not stable.

Also known as
walk-forward optimization · rolling out-of-sample testing · walk-forward testing

How it is calculated

            Window k: fit on [t_k, t_k + IS), test on [t_k + IS, t_k + IS + OOS)
Roll: t_{k+1} = t_k + OOS, then repeat
Reported performance = the stitched OOS segments only

WFE = annualised OOS return ÷ annualised IS return
IS 30% / OOS 9% → WFE = 0.30 (below ~0.5: parameters unstable)
Typical split: IS 12 months / OOS 3 months, rolled quarterly
          

Worked example: Twelve months in-sample return 30% annualised; the next three months out-of-sample return 9% annualised. Walk-forward efficiency = 9 ÷ 30 = 0.30 — parameters unstable.

Why only the out-of-sample segments count

Bailey, Borwein, López de Prado and Zhu show that after enough parameter trials a high in-sample Sharpe ratio is expected even when the strategy has no edge at all, because what gets kept is the best of N random draws. Lo and MacKinlay document the same data-snooping bias in academic asset-pricing tests. Walk-forward analysis is the practical defence: the parameters never see the window they are judged on, so the stitched out-of-sample record is what a live account would have earned had the rule been re-fitted on schedule. Count the trials, and treat the best in-sample result as the expected maximum of N draws rather than as a signal.

Reading walk-forward efficiency

Walk-forward efficiency is the annualised out-of-sample return divided by the annualised in-sample return. A rule that earns 30% in-sample and 9% out-of-sample has an efficiency of 0.30: seventy percent of the in-sample figure was the fit, not the market. Below about 0.5 the parameters are too unstable to trade; between 0.5 and 1 some edge is being lost to noise, which is normal; a figure well above 1 says more about that out-of-sample window than about the rule. QANTERION has no backtesting engine — its equivalent of an out-of-sample window is paper forward-testing on live market data before any live execution is enabled.

How it gets misread

Walk-forward analysis is most often undone by the person running it. The roll is run once, the out-of-sample record looks poor, and the parameter ranges or window lengths are changed until it looks good — at which point the out-of-sample windows have been optimised on and are in-sample. The second error is reading one good out-of-sample window as validation when the strategy simply placed few trades in it: a three-month window holding six trades carries no statistical weight either way.

Sources

Definitions are educational. Nothing here is investment advice, and no metric described on this page predicts future results.

Definitions are the easy part

Knowing what drawdown means is not the same as having a system that halts on it. QANTERION applies these limits while a strategy runs.