# Walk-forward analysis

> 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.

Canonical HTML page: https://qanterion.com/glossary/walk-forward-analysis
Updated: 2026-09-02
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.

## Calculate it

- Sharpe ratio calculator: https://qanterion.com/tools/sharpe-ratio-calculator
- Risk of Ruin Calculator: https://qanterion.com/tools/risk-of-ruin-calculator

## See also

- Backtesting: https://qanterion.com/glossary/backtesting
- Overfitting: https://qanterion.com/glossary/overfitting
- Paper trading: https://qanterion.com/glossary/paper-trading

## Sources

- [Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance](https://www.ams.org/notices/201405/rnoti-p458.pdf) — Notices of the American Mathematical Society, Vol. 61 No. 5 (2014)
- [The probability of backtest overfitting](https://doi.org/10.21314/JCF.2016.322) — Journal of Computational Finance (Risk Journals)
- [Data-Snooping Biases in Tests of Financial Asset Pricing Models](https://www.nber.org/papers/w3001) — National Bureau of Economic Research (Andrew W. Lo, A. Craig MacKinlay)

## Other languages

- 简体中文: https://qanterion.com/zh/glossary/walk-forward-analysis
- 繁體中文（台灣）: https://qanterion.com/zh-TW/glossary/walk-forward-analysis
- 繁體中文（香港）: https://qanterion.com/zh-HK/glossary/walk-forward-analysis
- 日本語: https://qanterion.com/ja/glossary/walk-forward-analysis
- 한국어: https://qanterion.com/ko/glossary/walk-forward-analysis
- Português (Brasil): https://qanterion.com/pt-BR/glossary/walk-forward-analysis
- Türkçe: https://qanterion.com/tr/glossary/walk-forward-analysis
- Bahasa Indonesia: https://qanterion.com/id/glossary/walk-forward-analysis
- العربية: https://qanterion.com/ar/glossary/walk-forward-analysis

## Risk notice

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