Backtesting

Walk-forward analysis explained

By ForwardTested Research · Updated · 3 min read

Bar chart of results in five unseen walk-forward test windows
Bar chart of results in five unseen walk-forward test windows

Short answer

Walk-forward analysis tunes a strategy on one block of history (in-sample), tests it on the next block it never saw (out-of-sample), then slides both windows forward and repeats. Joining all the unseen blocks gives an equity curve made only from data the strategy wasn't tuned on, a far more honest estimate than one big backtest.

Key points

On this page
  1. How it works, step by step
  2. Reading the result
  3. Why it matters for prop firms
  4. A worked example
  5. Choosing window sizes
  6. Anchored vs rolling
  7. Turning the result into a prop firm decision
  8. Common mistakes

How it works, step by step

  1. Pick an in-sample window (e.g. Jan–Dec 2022) and an out-of-sample window (Jan–Mar 2023).
  2. Optimise settings on the in-sample window only.
  3. Run those settings, unchanged, on the out-of-sample window and record the result.
  4. Slide both windows forward by the out-of-sample length and repeat.
  5. Stitch every out-of-sample result into one equity curve.

Reading the result

What you seeWhat it suggests
Out-of-sample curve rises steadilyThe optimising process finds real edges
Efficiency above ~50%Unseen results keep a good share of in-sample results
Efficiency near 0% or negativeOptimisation mostly fits noise
Wildly different settings each windowNo stable edge to find

Why it matters for prop firms

A challenge is, by definition, out-of-sample: it happens after you built the strategy. Walk-forward results are the closest a backtest gets to what a challenge will feel like. Feed the stitched out-of-sample trades into Challenge Replay instead of the full backtest for a more honest pass rate.

A worked example

Suppose you optimise a moving-average strategy on gold. You use 12-month in-sample windows and 3-month out-of-sample windows, rolling from 2021 to 2025. That gives about 12 out-of-sample quarters. In-sample, the best settings average +18% a year. Stitched together, the out-of-sample quarters average +8% a year. Walk-forward efficiency = 8 ÷ 18 ≈ 44%. Not perfect, but positive: the process of optimising finds something that partly survives. If the stitched result were −2%, you'd know the optimiser was mostly finding noise.

Choosing window sizes

ChoiceRule of thumbIf wrong
In-sample lengthLong enough for at least 100 tradesToo short: the optimiser fits noise
Out-of-sample lengthAbout 20–30% of in-sampleToo long: settings go stale
StepEqual to out-of-sample lengthNo overlap between unseen windows

Strategies that trade rarely need longer windows; scalpers can use shorter ones.

Anchored vs rolling

In a rolling walk-forward, the in-sample window keeps the same length and slides. In an anchored one, it always starts at the beginning of the data and grows. Anchored uses more data but adapts more slowly to changing markets; rolling adapts faster but each optimisation sees less. Try both: if they disagree wildly, the strategy's edge is unstable.

Turning the result into a prop firm decision

Export only the out-of-sample trades and replay them against your firm's rules. That pass rate is the most honest estimate a backtest can give, because every trade in it came from settings chosen without seeing it. If it's much lower than the full-backtest pass rate, plan for the lower number.

Common mistakes

  • Peeking at the out-of-sample period and re-tuning.
  • Windows too short to hold enough trades.
  • Optimising so many settings that every window finds something.
  • Ignoring costs in the out-of-sample run.

Questions traders ask

Does MT5 support walk-forward testing?
MT5's tester has a 'Forward' option that holds back the last part of the period as an unseen test. A full rolling walk-forward needs repeated runs or a script.
Is walk-forward the same as forward testing?
No. Walk-forward analysis uses historical data split into windows. Forward testing uses live prices as they happen.
How many walk-forward windows do I need?
Enough out-of-sample windows to see a pattern: 8–12 is a reasonable start, more is better.
Can I walk-forward test without coding?
Yes, manually: optimise one period, test the next, record, repeat. It's slower but works in MT5 or TradingView.

Sources and method

Prop firm rules in this guide come from our open rules table (standard 2-step, phase 1, checked against public sources on 28 Oct 2026). Firms change rules often: confirm on the firm's own site.

Read next