One of the most powerful features of MetaTrader 5 is the built-in Strategy Tester. It lets you test a trading strategy on historical data to see how it would have performed in the past. If you’ve ever wondered “would this strategy have made money?” this is how you find out.
The Strategy Tester is also one of the most misused features in MT5. Most beginners run a test, see a positive return, and immediately start trading the strategy live — only to lose money because they didn’t test it properly.
In this guide, I’ll walk you through exactly how to use the MT5 Strategy Tester, how to interpret the results, and how to avoid the most common backtesting mistakes.
What Is the Strategy Tester?
The MT5 Strategy Tester is a built-in tool that runs an Expert Advisor (EA) — an automated trading strategy written in MQL5 — on historical price data. It simulates what would have happened if you’d run that strategy in the past, giving you detailed performance statistics.
You can use it to:
– Test if a strategy is profitable
– See what the drawdown looks like
– Find the best parameters for a strategy
– Compare different strategies
– See how a strategy performs on different pairs and timeframes
But here’s the catch: the results are only as good as the data and the settings you use. Garbage in, garbage out.
Step 1: Open the Strategy Tester
You can open the Strategy Tester in a few different ways:
- Go to View → Strategy Tester in the menu
- Press Ctrl+R
- Click the Strategy Tester icon in the toolbar (looks like a play button on a chart)
The Strategy Tester panel will open at the bottom of the screen. It has several tabs: Settings, Inputs, Optimization, Results, Graph, etc. We’ll go through each one.
Step 2: Choose Your EA and Settings
This is the most important step. The settings you choose will determine whether your backtest is reliable or completely useless.
Here’s how to set it up properly:
-
Expert Advisor: Select the EA you want to test from the dropdown. If you don’t have any EAs installed, MT5 comes with a few built-in examples.
-
Symbol: Pick the currency pair or asset you want to test on. I usually start with XAUUSD or EURUSD because they have good historical data.
-
Timeframe: Choose the timeframe your strategy is designed for. If you’re testing a daily chart strategy, use D1. Don’t test a 4-hour strategy on M1 data.
-
Model: This is critical. Set it to “Every tick” for the most realistic results. “Every tick” simulates every single price change — it’s the slowest but most accurate mode.
Avoid “Open prices only” and “OHLC” — they’re faster but much less accurate, especially for strategies that use stop losses and take profits.
-
Date range: Set the start and end dates for your test. Test at least 2-3 years of data. Testing on 3 months of data tells you almost nothing. The longer the test period, the more reliable the results.
-
Deposit: Set your starting account size and currency. $10,000 USD is a good default.
-
Leverage: Use realistic leverage. 1:100 is standard for forex. Don’t use 1:1000 to inflate the results — that’s not how you’d actually trade.
Step 3: Set the Input Parameters
Go to the Inputs tab. This is where you can change the EA’s settings — indicator periods, stop loss sizes, take profit levels, etc.
If you’re just testing a strategy for the first time, use the default settings. If you start changing parameters to make the results look better, you’re over-optimizing (curve fitting), which I warned about in my backtest analysis article.
Important: Don’t optimize on your first test. Run it with default parameters first. Only go to the Optimization tab if you’ve already confirmed the basic strategy is profitable.
Step 4: Run the Test
Click the Start button (the green triangle) and wait. How long it takes depends on:
- How much data you’re testing (more years = longer)
- Which model you’re using (Every tick = slowest)
- How complex the EA is
- How fast your computer is
For a 5-year test on daily data with Every tick mode, expect it to take a few minutes. For 1-minute data over 5 years, it could take 30 minutes or more.
While it’s running, you can watch the equity curve build in the Graph tab. Don’t get too excited or depressed during the test — wait for the final results.
Step 5: Interpret the Results
When the test finishes, click on the Results tab. You’ll see a lot of numbers. Here’s what matters most:
| Metric | What to Look For |
|---|---|
| Total Net Profit | Positive, obviously. But don’t just look at the dollar amount — look at percentage return. |
| Profit Factor | Above 1.5 is good, above 2.0 is excellent. Below 1.2 is basically break-even. |
| Expected Payoff | This is the average profit per trade. Positive is good. |
| Max Drawdown | This is the most important risk metric. Under 20% is good, under 10% is excellent. |
| Total Trades | More trades = more statistically significant. You want at least 50-100 trades minimum. |
| Win Rate | Higher is nice, but what matters more is the win rate combined with profit factor. |
| Sharpe Ratio | Above 1.0 is good, above 1.5 is excellent. Risk-adjusted return. |
The Graph tab shows your equity curve visually. The ideal equity curve is a smooth line trending up with shallow drawdowns. If it looks like a rollercoaster with deep drops, the strategy is too volatile.
The Deals tab shows every single trade the EA took. Scroll through a few of them to make sure the entries and exits make sense. If you see trades that look weird — entries in the middle of nowhere, stops that never should have been hit — something might be wrong with the EA or your settings.
The 5 Most Common Backtesting Mistakes
1. Too little data. Testing on 6 months of data is meaningless. Market conditions change, and you need to see how the strategy performs in trending markets, ranging markets, high volatility, and low volatility. Minimum 2-3 years, ideally 5+.
2. Wrong testing model. Using “Open prices only” because it’s faster. This model doesn’t simulate intrabar price movement, so any strategy with stop losses or take profits will give wrong results. Always use “Every tick” for your final tests.
3. Over-optimization. Running the optimizer until you find the exact parameters that give perfect results on historical data. This is curve fitting — the strategy looks amazing in backtest and terrible in live trading. Use simple settings, and validate on out-of-sample data.
4. Ignoring spread and commissions. If you test with zero spread, your results will be unrealistically good. Make sure your tester is using realistic spread values. Most brokers provide historical spread data in their MT5 servers.
5. Survivorship bias. You test 10 strategies, 9 lose money, 1 wins, and you conclude “the strategy works.” But that 1 winner might just be luck. You need to test on data the strategy hasn’t seen before (out-of-sample testing) to confirm it’s real.
How to Do a Proper Backtest (The Process)
Here’s the process I follow for every strategy I test:
- Split your data into in-sample (first 70%) and out-of-sample (last 30%).
- Develop and optimize the strategy using only in-sample data.
- Test the final version on the out-of-sample data without changing anything.
- Compare results. If the out-of-sample performance is at least 60-70% of the in-sample performance, the strategy might be robust. If it drops by more than half, it’s probably over-fit.
- Test on other pairs/timeframes. If the strategy only works on one specific pair on one specific timeframe, it’s less likely to be robust.
This process takes longer, but it gives you results you can actually trust. A strategy that passes out-of-sample testing is one I might actually consider trading live.
Final Tips
- Use quality data. Some brokers have better historical data than others. If your results look weird or glitchy, try a different broker’s data.
- Run multiple tests. Don’t trust a single backtest. Run it with slightly different parameters, on different date ranges, on different pairs. See if the edge holds.
- Start with forward testing. Once a strategy passes backtesting, try it on a demo account for a few months before going live. Real market conditions are always different from historical data.
- Expect disappointment. Most strategies don’t work. That’s normal. The point of backtesting is to find out what doesn’t work without losing real money.
The MT5 Strategy Tester is a powerful tool, but like any tool, it’s only as good as the person using it. Test properly, be honest with yourself about the results, and never trust a backtest that looks too good to be true.
Want to see my strategy testing process in action? Follow along on Telegram @DongyiTrade or email contact@dongyitrade.com.

