DocsRun Modes

Walk-Forward Analysis (WFA)

Walk-Forward Analysis is the gold standard for testing whether optimized parameters generalize to unseen data. It splits the date range into rolling windows and alternates between optimization and validation.

Key Concepts

TermMeaning
In-Sample (IS)The training window — parameters are optimized here
Out-of-Sample (OOS)The testing window — parameters are validated on unseen data
FoldOne IS + OOS pair
Step SizeHow many candles the window advances between folds
WFEWalk-Forward Efficiency — ratio of OOS to IS performance

How It Works

              Fold 1                    Fold 2                    Fold 3
  ├────── IS ──────┤── OOS ──┤
              ├────── IS ──────┤── OOS ──┤
                          ├────── IS ──────┤── OOS ──┤
  1. The date range is divided into overlapping folds
  2. For each fold: a. Optimize on the IS window (full grid search) b. Backtest the IS window with the best parameters → IS metrics c. Backtest the OOS window with the same parameters → OOS metrics
  3. Compare IS vs OOS performance across all folds to measure robustness

Configuration

SettingDescription
In-Sample PeriodLength of the training window (days or candles)
Out-of-Sample PeriodLength of the test window
Step SizeHow far to advance between folds (defaults to OOS size)
Parameter RangesSame min/max/step as Optimization
Optimization TargetMetric used to select best parameters per fold

Parameter Policy

ModeBehaviour
Optimize (default)Re-optimize parameters for each fold's IS window
FixedUse one set of parameters for all folds (tests robustness of a known configuration)

Results

Each fold reports IS and OOS metrics independently. The summary includes:

  • Average OOS return and Sharpe ratio across all folds
  • Win rate — fraction of folds with positive OOS return
  • Consistency — how stable OOS returns are across folds (higher is better)
  • Robustness rating — Excellent, Good, Fair, or Poor

Robustness Rating

RatingCriteria
ExcellentOOS win rate >= 70% AND consistency >= 0.6
GoodOOS win rate >= 60% AND consistency >= 0.5
FairOOS win rate >= 50% AND consistency >= 0.4
PoorBelow Fair thresholds

Overfitting Metrics

MetricWhat It Measures
Walk-Forward Efficiency (WFE)OOS annualised return / IS annualised return. Values near 1.0 mean the strategy performs similarly on unseen data. Values far below 1.0 suggest overfitting.
Performance DropPercentage of IS performance lost in OOS
Sharpe Ratio DropDifference between IS and OOS Sharpe ratios
Win Rate DropDifference between IS and OOS win rates

Tips

  • A strategy rated Good or Excellent is far more trustworthy than one that only looks great in a single backtest
  • If WFE is below 0.5, the optimized parameters are likely overfitting to historical noise
  • Use IS percentages between 60–80% of the total window — too small won't optimize well, too large won't leave enough OOS data
  • Run WFA on the same date range you optimized on to verify the optimization was not a fluke
  • If results are Poor, simplify the strategy (fewer parameters, longer indicator periods) before tuning further
WFAwalk-forwardin-sampleout-of-sampleoverfittingrobustnessvalidationfold