Walk-forward optimization
The honest version of optimization. Train on past, test on next, roll, repeat.
What it is
A walk-forward optimization (WFO) splits historical data into N consecutive folds. In each fold, an in-sample (IS) window is used to find the best parameters for your strategy, and the immediately-following out-of-sample (OOS) window measures how those parameters performed on data the optimizer never saw. Repeat for every fold; the OOS results, stitched together, are what you trust.
Why it matters
Single-shot backtests reward curve-fitting. A strategy that returns 4× on a single 2-year window is usually just the right shape for that window. WFO destroys most of that illusion — if a strategy can't survive being re-optimized on rolling windows, it shouldn't be live.
How Noon Barbari does it
- Rolling-window splitter with configurable IS / OOS sizes — default 60 days IS, 30 days OOS.
- Optuna-based parameter search per fold with N trials (default 50). All search spaces are declared in the strategy YAML.
- Per-fold OOS metrics are aggregated into a robustness score that weights consistency over peak return.
- Stress tests apply slippage shocks, fill rejections, and regime-shuffled price series to the OOS replay.
Robustness score
A single number in [0, 1] that summarises how well a strategy walked forward. >0.6 = worth paper-trading; <0.4 = curve-fit; in between = run more folds. The breakdown — return consistency, drawdown stability, hit-rate variance — is in the WFO report.
When to trust
After at least 6 folds with OOS robustness > 0.5 and no fold worse than -10 % return. If a single fold blows up, the strategy is not as robust as the aggregate score suggests.