MT5 Strategy Tester and walk-forward testing: what each one checks
By the PipYard team · 7 min read · Updated
MetaTrader 5's Strategy Tester and a walk-forward test answer different questions. The tester shows how your Expert Advisor would have traded on your broker's price history, down to the tick. A walk-forward test shows whether your way of choosing the EA's settings keeps working on months it never saw. Neither replaces the other.
What the MT5 Strategy Tester checks
The Strategy Tester runs your EA's own MQL5 code against history from your broker's server. According to MetaTrader 5's help:
- Tick-level simulation. It can test on real ticks provided by the broker ("Every tick based on real ticks"), on ticks generated from one-minute bars ("Every tick"), or on faster, rougher modes such as "1 minute OHLC" and "Open prices only". Where real tick history is missing for a minute, it generates ticks for that minute instead.
- Your broker's history. It tests on the symbol and the price history of the broker account your MT5 is connected to, downloading what it needs from the broker's server.
- Optimisation. It searches input values either completely or with a genetic algorithm, spread over computing agents on your machine, other machines you run, or the paid MQL5 Cloud Network.
- Visual mode to watch the EA trade bar by bar, and multi-currency EAs.
That makes it the right tool for questions about execution: does the EA place, modify and close orders the way you meant, and does a strategy with tight stops or quick targets survive the order in which prices really arrived inside each bar?
The tester's forward option
MT5 also guards against over-optimisation with a forward period. You pick how much of the date range to hold back: the last half, third or quarter, or from a date you choose. The tester optimises on the earlier part, then reruns the best passes (the top 10% of a complete search, or 25% of a genetic one) on the held-back part and shows both sets of results side by side.
That is one out-of-sample test: one optimisation, one forward stretch, always the most recent part of the history. It's a real check, and much better than none. But a single stretch can be unusually kind or unkind to a strategy, and it tests the settings picked once, not the habit of re-picking them as you would in practice. MetaTrader 5's help describes one forward period per run; we didn't find a built-in option there for rolling, repeated windows.
What a walk-forward test adds
A walk-forward test repeats the forward check across the whole history. Choose settings on a training window, judge them on the next test window, roll both forward, and repeat; then join every test window's trades (the walk-forward guide explains it step by step). On eight years with 24-month training and 3-month test windows, that is about two dozen out-of-sample tests instead of one.
- It tests the procedure of choosing settings, which is what you will keep doing, not one set of settings.
- It shows whether results are spread across time or carried by one period: the share of profitable test windows.
- Every trade in the joined result is out of sample, so the numbers that matter can be read without in-sample flattery.
Side by side
| Question | MT5 Strategy Tester | Rolling walk-forward |
|---|---|---|
| Does the EA's code trade as intended? | Yes: runs the EA itself | Only if it runs the EA |
| Fills within a bar, on real ticks | Yes, where the broker has tick history | Usually bar by bar, with assumptions |
| Your broker's own price history | Yes | If you test on the same history and costs |
| Out-of-sample stretches | One per run (forward period) | Many, one per test window |
| Settings re-chosen over time | No: chosen once | Yes: in every training window |
| Is the result spread across time? | Not directly | Share of profitable windows |
How PipYard uses both
PipYard has two engines, and a strategy can go through both:
- Research (in the cloud). Runs the walk-forward on PipYard's servers from the strategy's rules, on your MT5 price history or an uploaded file. It works bar by bar and leans conservative: a signal at a bar's close fills at the next bar's open, every entry and exit pays half the spread plus slippage, and when one bar touches both the stop and the target, the stop counts first.
- Broker-accurate (your MT5). The PipYard Connector runs an MQL5 EA in the Strategy Tester of your own MT5, then turns MT5's report into the same report layout as a research run, so the two compare line by line. A visual-rules strategy can be turned into an EA that mirrors the research engine bar for bar; or bring your own EA.
- Test in windows. A broker-accurate run can also be split into consecutive windows, each run on its own in your tester with the same inputs and starting deposit. PipYard fits nothing between them, so the windows are out of sample only if the EA's inputs weren't tuned on those dates, and the report says so.
A sensible order: walk-forward the rules in the research engine to see whether the idea holds up; run the EA broker-accurate on real ticks to see whether execution changes the picture; then forward test on a demo account, where PipYard compares each demo trade with the backtest.
Which to trust when they disagree
- The research run looks good, the tick-accurate run doesn't. The edge may live inside the bar: tight stops, small targets or fast exits that bar-by-bar testing can't resolve. Believe the tick-accurate run, and check how much of it used real ticks: the tester's report shows the share.
- The tester looks good over the whole history, the walk-forward doesn't. The settings probably suit that one history. The walk-forward result is the better guide to next year.
- Both look good. That's the point to test on a demo account, not to go live: neither test sees your real fills, delays or missed signals.
MetaTrader 5 features as described in MetaTrader 5's help on 25 Nov 2026: Strategy Testing, Real and Generated Ticks, Strategy Optimization.