A backtest that looks good is not evidence. It is a question. The question is whether what you found is real or whether you hunted through enough parameter combinations that something was going to look good anyway. Walk-forward testing is the only honest way to answer it, and most traders skip it entirely.
Here is the specific trap. You run an optimisation over five years of EURUSD. The equity curve is beautiful. You adjust the moving average period until the drawdown shrinks, tweak the ATR multiplier until the win rate climbs, and eventually arrive at a set of parameters that fit that five years nearly perfectly. Then you trade it live and it does nothing. Not a blowup. Just nothing. The same flat line that a coin flip would produce.
You did not find an edge. You found the shape of that specific five years.
What the single backtest actually shows
A backtest measures how well a fixed set of parameters described a fixed historical period. That is a useful thing to know, but it is not what you want to know. You want to know whether those parameters generalise: whether the relationship they are exploiting is persistent, or just a feature of the sample.
The problem gets worse with optimisation. Every time you adjust a parameter to improve the backtest result, you are fitting to noise as much as to signal. The more degrees of freedom you have, the more noise you can absorb. A strategy with twelve parameters and a gorgeous in-sample curve is almost certainly overfit. A strategy with two parameters and a modest in-sample curve has a fighting chance.
There is no reliable way to tell them apart from the in-sample result alone.
How walk-forward works
The mechanics are not complicated. You split the history into a series of windows. Each window has an in-sample portion, where you optimise, and an out-of-sample portion, where you do not touch anything and you simply run the best parameters forward.
A typical setup: 12 months in-sample, 3 months out-of-sample. You optimise on months 1 to 12, collect the performance on months 13 to 15, then slide the window forward and repeat. The out-of-sample segments are concatenated into a single equity curve that was never seen during any optimisation step.
That curve is what you actually have. The in-sample results are irrelevant now.
MT5's Strategy Tester has a built-in walk-forward mode. Enable it in the backtest settings, set the forward percentage, and the tester runs the optimisation and the out-of-sample pass automatically. The forward result is the one you read.
What a genuine result looks like, and what failure looks like
A strategy that generalises will show out-of-sample performance that is worse than the in-sample peak. Always. If your walk-forward result matches your in-sample result, something is wrong with your test setup, not your strategy.
The question is how much degradation you should accept. There is no universal number. A rough benchmark: if the out-of-sample result has roughly half the Sharpe of the in-sample optimised result, you have a plausible signal. If it has a tenth, you are looking at noise that survived the filter by chance.
Flat or negative out-of-sample equity means the strategy does not generalise. This is the right time to stop. Not to re-optimise with different parameters, not to try a different instrument. Stop. The strategy does not work.
The emotional difficulty here is real. You spent two weeks building it. The in-sample curve is beautiful. The temptation is to find a reason the walk-forward test is wrong. It is not wrong. It is the only result that matters.
The specific failure mode: rolling windows that drift
Walk-forward can still fool you in one particular way. If the market regime shifts sharply mid-test, a strategy that worked in the first half of the out-of-sample windows will fail in the second half, and the aggregated curve may still look acceptable. You will not see this if you only look at the total equity curve.
Always look at the out-of-sample segments individually. If early segments are profitable and later ones are flat or negative, the strategy's edge was regime-specific, not persistent. That is worth knowing before you trade it.
A related issue: the optimisation window can be too short or too long for the pattern you are trying to capture. A mean-reversion strategy tuned on a trending period will optimise to something that happens to work in trends, not something that captures mean-reversion. The window length is a parameter too, and it should match the typical duration of the condition you are trading.
The number that should worry you most
It is not the win rate. It is not the total return. It is the ratio of in-sample Sharpe to out-of-sample Sharpe, measured consistently across all windows.
Call it the walk-forward efficiency. A number above 0.5 suggests the strategy is capturing something real. Below 0.3, you are mostly overfitting. Above 1.0 is impossible unless your test setup is broken.
I have not measured this on enough strategies to give you a distribution. That caveat stands. What I can say is that every time I have run this calculation on a strategy that felt promising, the ratio was the single most useful number in the output.
One practical change that costs nothing
Before you run any optimisation, reserve the last six months of your data and do not touch it. Optimise on everything before that. When you think you are done, run a single forward pass on the reserved data. Do not go back and adjust. That six months is your verdict.
If it fails, it fails. Write down what the parameters were, what the in-sample result was, and what the out-of-sample result was. That record is worth keeping. You will start to see patterns in what kinds of strategies survive and what kinds do not, and that knowledge is more valuable than any individual equity curve.
Where to run this
None of the techniques above require a specific broker — the Python API works against any MT5 terminal. We run our own testing on Axi, which we use because of its MT5 support, raw-spread Pro account, and the fact that it doesn't restrict DLL imports or WebRequest calls in EAs. If you're already with a broker you like, stay there.
If you do want to try Axi, our introducing-broker code is 4592551. It costs you nothing and supports the research we publish here.
Open an Axi Account →Risk notice. Trading leveraged instruments carries a high risk of loss. Nothing in this article is financial advice, and no strategy or integration described here is guaranteed to be profitable. Test everything on a demo account before risking capital.
AI Trade Lab is an Axi Introducing Broker (IB 4592551). We may receive compensation if you open an account through our links. This does not change what we publish or how we test.
