Chapter 6 · Pass the challengeGuide 37 of 42
Backtest vs Forward Test vs Walk Forward, Explained
Three ways of testing a strategy, explained with a tool you can drag and a study: why the best version's backtest lies and the forward test does not.
A backtest tries the strategy on the data you used to choose it; a forward test tries it on unseen data; walk forward repeats the forward test on successive windows. The difference shows when you try many versions. In the study, keeping the best of 50 versions with no edge at all, the backtest shows a profit factor of 1.30 and looks good 95.5% of the time. In the forward test it goes back to 1.00.
The picture, in three numbers
Try it yourself: drag the line
Below are twenty versions of a strategy that has no edge at all: they are numbers drawn at random. The blue line is the version that did best before the dashed line, the one you would choose looking at the backtest. The orange part is what it does afterwards. Move the line, change the number of versions, press “New strategies”.
Drag the line on the chart: on the left the data you choose the version on, on the right the data it has never seen.
On unseen data the chosen version breaks even: what the backtest showed was chance.
What you see happens almost every time: the blue line climbs, the orange one goes sideways. It is not bad luck. The best version of the past was chosen precisely because it did well in the past: afterwards, it goes back to being what it is. If you tick the real-edge box, the orange part keeps climbing, but less than the blue one promised.
The three words, one by one
- 1BacktestYou try the strategy on the past. It is fast and costs nothing, but it is the same past you chose the rules and parameters on: it tends to agree with you.
- 2Forward testYou try the strategy on data it has never seen: the last piece of history kept aside, or the following months in demo. It is the first real exam.
- 3Walk forwardYou repeat the forward test several times, moving the window. It tells you whether the strategy holds up even when you choose it again at every round, as you would in reality.
The more versions you try, the more the backtest lies
In the chart 100 means a profit factor of 1.00, that is break-even. The backtest line rises with every extra version, up to 1.30 with 50 versions. The forward test line stays flat. You have not improved the strategy: you have only searched longer for the luckiest version.
Walk forward, drawn
The advantage over a single forward test is that the test pieces are many and cover different periods: a strategy that gets through one piece by chance will hardly get through all of them. And it tells you another useful thing: what happens if, as almost everyone does, you adjust the parameters now and then.
Three cases compared
| Case | Backtest | Forward test | Walk forward | The backtest overstates by |
|---|---|---|---|---|
| No version has an edge | 1.24 | 1.00 | 1.00 | 0.24 |
| All have the same edge | 1.41 | 1.14 | 1.15 | 0.27 |
| Mixed | 1.31 | 1.11 | 1.10 | 0.20 |
“Mixed” means one version in five has a real edge and the others do not. The real edge in the study is worth a profit factor of 1.15.
The middle row is the most instructive. Even when every version has the same real edge, the best one's backtest says 1.41 and the forward test 1.14. The strategy works, but less than it seems: whoever sizes risk on the backtest number risks too much.
The mixed case brings the good news. Trying many versions is not wrong: with 50 versions, the best one is one of those with a real edge 88.8% of the time. Searching helps. What does not help is believing the number that comes out of the search: the forward test is how you find out which of the two things happened to you.
How to do it with your strategy
- 1Cut the history before you startSet aside the last third of the data and do not open it. Build and choose only on the first two thirds.
- 2Count the versionsWrite down how many variants you tried. The more there are, the bigger the discount on the backtest result.
- 3Open the piece kept aside only onceIf you look at it, adjust and look again, that has become a backtest too.
- 4Compare the two numbersIf the forward test is much lower than the backtest, the difference was luck. Use the lower number to decide the risk.
- 5Then the prop firm's rulesA strategy that holds on unseen data still has to be tried inside the drawdown, daily loss and timing of a challenge.
Caveat: the study and the tool use computer-generated numbers, with no costs and no market data; they are there to show the effect, not to measure your strategy. A forward test that goes well reduces the risk of fooling yourself, it does not remove it: no test guarantees a result.
Try your backtest on a prop firm's rules › · Does backtesting work? › · Backtesting vs Monte Carlo: the difference ›
Frequently asked questions
What is the difference between a backtest and a forward test?
A backtest tries the strategy on the data you used to build and choose it. A forward test tries it on data it has never seen, which came afterwards. In the study, trying 50 versions of a strategy with no edge at all and keeping the best, the backtest shows a profit factor of 1.30; in the forward test it goes back to 1.00.
What is walk forward?
It is a repeated forward test. You choose the version on one piece of history, test it on the next piece, then move the window and start again. In the end you look only at the sum of the test pieces. The study uses 5 rounds: 200 trades to choose, 100 to test.
Is a forward test the same as demo trading?
Demo trading is a forward test done in real time: it is the most honest one, but it is slow. The same check can be run right away by keeping the last part of the history aside and never looking at it while you build the strategy. It only counts if you really do not look.
How many versions of a strategy can I try?
As many as you like, but the more you try the more the best one's backtest lies. With a single no-edge version the backtest looks good 5.1% of the time; with 50 versions 95.5%. The forward test stays at 5.8%: it is the one telling the truth.
If the forward test goes badly, should I throw the strategy away?
You should stop trusting that backtest. If the result on unseen data is much lower than the one on the data used to choose, the difference was luck. What is left in the forward test is the honest estimate of what to expect.
Before you buy a challenge, test it.
The Validator runs your strategy on the real rules of every prop and tells you where you would pass. The props, prices and coupons are all on one page.
Educational content, not financial advice. Prop firm challenges are simulated accounts; most traders do not pass them and trading involves risk. Links to props are affiliate links.