Walk-Forward Analysis
Walk Forward Analysis (WFA) is a rigorous strategy validation technique built into Stratifyre that tests whether optimized parameters hold up on unseen data. Instead of optimizing your parameters across your historical data simultaneously—which risks overfitting—WFA divides the timeline into sequential folds.
It optimizes your parameters on an in-sample (IS) window and then validates those parameters on a separate out-of-sample (OOS) window. The result is a realistic picture of how your strategy would have actually performed if you had repeatedly optimized it periodically throughout history.
Why Walk Forward Analysis Matters
Section titled “Why Walk Forward Analysis Matters”A single backtest can produce amazing results by “fitting” parameters to historical quirks that will not repeat. Walk Forward Analysis exposes this fragility by testing parameters on data the optimizer never saw. By stitching together all out-of-sample windows, WFA produces a realistic equity curve that represents achievable returns.
Finally, WFA reveals parameter stability. WFA will naturally show you whether your strategy’s optimal parameters stay consistent over time or drift wildly over the years.
The Walk Forward Engine
Section titled “The Walk Forward Engine”Each fold consists of an in-sample (training) window followed by an out-of-sample (validation) window. By default, the engine uses Rolling Mode:
Fold 0: [------- IS -------][-- OOS --]Fold 1: [------- IS -------][-- OOS --]Fold 2: [------- IS -------][-- OOS --]The IS window slides forward by one OOS length for each fold. Each fold sees a different slice of history. Stratifyre also supports Anchored Mode (training data continuously grows) and Split-Only Mode.
Processing Folds
Section titled “Processing Folds”For each fold, Stratifyre automatically handles the procedure:
- In-Sample Phase: Run the optimizer on the IS window to find the best parameters using Monte Carlo or Grid Search.
- Parameter Selection: Pick the parameter set that maximizes your chosen objective function (e.g. Sharpe Ratio, CAGR, Profit Factor).
- Out-of-Sample Phase: Run a backtest on the OOS window using the selected parameters.
- Metrics Calculation: Compute per-fold metrics including IS/OOS returns, Sharpe ratios, and degradation.
Aggregating Results
Section titled “Aggregating Results”After all folds complete, WFA-specific metrics are calculated to score the strategy’s robustness:
- Walk Forward Efficiency: Ratio of aggregate OOS performance to aggregate IS performance. Values near 100% indicate parameters generalize well.
- Consistency Ratio: Percentage of folds where OOS performance was positive. Higher values indicate more reliable strategies.
- Average Degradation: Mean degradation ratio across all folds. Values near 1.0 are ideal; values near 0 or negative indicate overfitting.
Start with at least a rolling mode with 12 months in-sample and 3 months out-of-sample, and adjust according to your strategy constraints.
