Browsed many website to find a good example and explanation, here is what I found the most “simple” at strategyquant.com website:
What is Walk-Forward optimization/analysis?
Walk-Forward optimization is generally a special type of backtest that is composed of multiple smaller backtests on optimizaiton periods. These optimization periods are split over the whole backtesting period and are always followed by Out of Sample tests with the optimized parameters.
It is a technique in which you optimize the parameter values on a past segment of market data, then verify the performance of the system by testing it forward in time on data following the optimization segment, and the process can be repeated over subsequent time segments.
How Walk-Forward optimization works
in walk-forward optimization, the data are divided into a configurable number of periods (5 in this example). Each period consists of optimization part and run part.

The program starts with optimization period 1. It will run the simple optimization on optimization period 1 to find the best parameter values. These parameter values are then applied to run period 1 – strategy is trading with the optimized parameters found in previous step.
At the end of run period 1, the system again runs simple optimization on a part of data marked as optimization period 2. It finds the best set of parameter values and they are again used for trading in run period 2.
This continues until the period 5, which is also the end of history data used in test.
Walk-Forward optimization simulates how you could work with the strategy during real trading – you can optimize it on some historical data and then trade it with the optimal values. After some time you’d want to reoptimize it and let it trade again.
What Walk-Forward optimization/analysis tells you?
It basically tells you if the startegy is robust enough and if its performance can be improved by reoptimization.
If strategy performance is worse during reoptimization than the original non-optimized startegy, it is a big signal to watch for curve fitting.
On the other side, if Walk-Forward optimized strategy performs better than non-optimized version on the same data, it tells you that :
- Your strategy will benefit from optimization, so you should periodically reoptimize it to get the best performance
- It also means that the startegy is robust enough to cope with market changes (using reoptimization) and there is a big chance it will work also in future.