The Strategy Tester is built into MetaTrader 5 (MT5). It runs a trading bot over past prices so you can see how it would have done before you risk any money. A backtest is not a promise of future profit, but a bad backtest is a very good reason not to go live. This guide shows you how to set one up and how to read the results.
Open the Strategy Tester
In MT5, go to View > Strategy Tester or press Ctrl+R. A panel opens at the bottom of the screen with tabs along its bottom edge. You set the test up on the Settings tab.

Set up the test
- Expert: pick your bot from the list. It must already be installed (see installing an Expert Advisor).
- Symbol and timeframe: the market and chart timeframe the bot is made for, for example EURUSD and H1.
- Date: choose Custom period and set a start and end date. Use several years if you can, so the test covers calm and wild markets.
- Forward: this holds back the last part of your dates as an unseen test. For example, 1/3 keeps the last third aside. It matters most when you optimise (see below).
- Delays: "Zero latency" assumes perfect fills. Choosing a delay is harsher and closer to real life.
- Modelling: how MT5 fills in price moves between bars. See the next section.
- Deposit and leverage: set them to match the account you plan to use.
Then open the Inputs tab and set the bot's settings, such as trade size and stop loss. Use the same settings you will use on demo and live. Click Start.
Pick the right modelling
- Every tick based on real ticks: uses real price data from your broker, including real spreads. The most realistic, and the slowest. Use this for your final check.
- Every tick: MT5 makes up the ticks from one-minute bars. Good, but less exact.
- 1 minute OHLC: uses only each minute's open, high, low and close. Quick, for rough checks.
- Open prices only: the fastest, and only fair for bots that act once at the start of each bar.
A bot that uses tight stops or trades often can look great on a rough mode and fail on real ticks. If you only run one test, run it on real ticks.
Read the results
When the test finishes, open the Backtest tab for the numbers and the Graph tab for the account balance over time. The figures that matter most:
- History quality: how much of the test used real ticks. Below 90% or so, treat the result with care.
- Total net profit: profit after the costs the test included.
- Profit factor: money won divided by money lost. Below 1.0 the bot lost money. Close to 1.0 leaves little room for real-life costs.
- Equity drawdown maximal: the biggest fall from a high point, including open trades. Ask yourself if you could sit through that with real money.
- Total trades: with only a handful of trades, the result could be luck. More trades give a fairer picture.
- Recovery factor: net profit divided by the biggest drawdown. Higher is better.
On the Graph tab, a steady upward line is better than one big jump followed by a long flat or falling stretch. One lucky trade should not make the whole result.
Check the costs
Spreads and commission eat into every trade. "Every tick based on real ticks" includes the broker's real spreads. If your account also charges commission (for example a "raw spread" account), check that the report shows a commission figure. If it does not, the result looks better than real life.
Watch it trade
Tick Visual mode on the Settings tab before you click Start. MT5 opens a chart and plays the test back so you can watch each trade. It is slow, but it is the best way to spot a bot doing something odd, such as opening many trades at once.
Optimising settings: handle with care
Set Optimization to on and MT5 tries many combinations of the bot's settings to find the "best" ones. The danger is curve fitting: settings that suit the past perfectly and fail on new prices. To protect yourself:
- Use the Forward option, so the best settings are also tested on dates they were not chosen on.
- Prefer settings where nearby values also do well. A single sharp peak is a warning sign.
- Keep the number of settings you change small.
After the backtest
- Run the bot on a demo account for two to four weeks with the same settings. If you need one, IC Markets (affiliate link) gives free MT5 demo accounts.
- Compare the demo trades with the backtest over the same weeks. Some gap is normal. A big gap needs explaining.
- Only then try a live account, with the smallest trade size.
Want a second opinion on your numbers? Put them into our free backtest checker. It flags common warning signs such as too few trades, a weak profit factor or a drawdown that is too deep.
Related guides
- How to set up a trading bot on MT5 (start here)
- How to install and attach an Expert Advisor in MT5
- How to run an MT5 bot 24/7 on a VPS
- Backtest checker
Risk warning: CFDs are complex instruments and come with a high risk of losing money quickly because of leverage. Most retail investor accounts lose money when trading CFDs. Think about whether you understand how CFDs work and whether you can afford the high risk of losing your money.
This guide is for education only and is not financial advice. Past results, including backtests, do not guarantee future returns. Trading carries risk; you can lose more than you expect.