Lemonn Mobile Sticky Banner

Demat Account Registration Banner

Walk-Forward Analysis

Walk-forward analysis is a robust method for testing trading strategies that combines backtesting and forward testing in rolling windows. Instead of testing a strategy on one historical period, walk-forward analysis repeatedly optimises on a past period (in-sample) and then tests on the immediately following period (out-of-sample), mimicking real-world deployment more accurately.

What Is Walk-Forward Analysis?

Walk-forward analysis divides historical data into multiple windows. For each window:
1. The strategy is optimised on the “in-sample” (past) portion
2. The optimised parameters are tested on the “out-of-sample” (future relative to optimisation)
3. The window moves forward and the process repeats

By aggregating the out-of-sample results, you get a realistic picture of how the strategy would have performed if deployed in real time, without the benefit of hindsight.

Types of Walk-Forward Analysis

**Anchored walk-forward**: the in-sample period always starts from the beginning and grows as the window moves forward.

**Rolling walk-forward**: both in-sample and out-of-sample windows move forward together (fixed in-sample duration).

Example of Walk-Forward Process

In-sample: 2015-2018 (optimise parameters)
Out-of-sample: 2019 (test with those parameters)
Move window:
In-sample: 2016-2019 (re-optimise)
Out-of-sample: 2020 (test)
And so on…

The out-of-sample results from all windows are combined to represent the strategy’s expected real-world performance.

Walk-Forward Efficiency

Walk-forward efficiency = Out-of-sample return / In-sample return

A ratio of 0.6 or higher suggests the strategy generalises well. A ratio near 0 or negative indicates overfitting.

Why Walk-Forward Analysis Is Better Than Simple Backtesting

Simple backtesting uses one fixed historical period and does not simulate real-world deployment. Walk-forward analysis repeatedly tests the strategy “fresh” on unseen data, making it much more realistic.

Practical Example

A quant team develops a momentum strategy for Indian large-caps. They run a 5-year rolling walk-forward analysis:
– Optimise on years 1-3, test on year 4
– Optimise on years 2-4, test on year 5
– Continue for 8 years of data

The combined out-of-sample performance shows 15% CAGR with 18% maximum drawdown. The in-sample performance showed 25% CAGR. Walk-forward efficiency is 0.6, indicating reasonable generalisation.

Key Takeaways

– Walk-forward analysis combines backtesting and forward testing in rolling windows
– In-sample periods are used to optimise parameters; out-of-sample periods test those parameters
– Much more realistic than simple backtesting because it avoids look-ahead bias
– Walk-forward efficiency measures how well the strategy generalises from in-sample to out-of-sample
– Essential for quantitative and algorithmic traders before deploying any systematic strategy with real capital

Sleek Sticky Registration Footer