Quick answer: To backtest on MT5, open the MetaTrader 5 desktop terminal and select View → Strategy Tester (or press Ctrl+R). Choose a single Expert Advisor test, select the EA, symbol, chart timeframe, historical dates and tick-modeling method, check the inputs and account settings, then click Start. When the run finishes, inspect the results, graph and journal—not just the profit figure.
MT5 backtesting helps you investigate how a programmed strategy would have behaved with the available past data and test assumptions. It is one part of automated forex trading research; it cannot tell you what an EA will earn in a future live market. If the terminology is new, our forex Expert Advisors guide explains what EAs do before you start testing them. For software-selection considerations, see our forex trading bots and robots guide.
What Is Backtesting in MetaTrader 5?
MT5 backtesting uses past market data to simulate an Expert Advisor's decisions and trading operations. The built-in Strategy Tester runs the EA over a chosen historical period, applying the program's rules to the tester's price stream. It produces orders, position results, a balance/equity graph, statistics and diagnostic messages. These are simulated outcomes, not a verified live trading history.
The tool can help answer practical questions: Does an EA enter and exit positions as expected? Does it place trades when market conditions change? How sensitive are its results to the modeling method, risk inputs or costs? Do losses cluster during particular historical intervals?
MT5's native Strategy Tester is primarily intended for programmed strategies. Manually replaying a discretionary setup is a different activity and may require a separate simulator or other workflow. MetaTrader documents the official EA test process in its Strategy Testing help.
Before You Start: EA, Desktop MT5 and Historical Data
Prepare the terminal and confirm that the software is compatible. MT4 files such as .ex4 cannot be run as native MT5 EAs; MT5 uses .ex5 compiled programs and .mq5 source files. You also need enough relevant historical data for the intended instrument and test period.
| Check | Why it matters | What to do |
|---|---|---|
| MetaTrader version | The native Strategy Tester runs in the desktop terminal | Use the MetaTrader 5 desktop environment rather than expecting identical functionality in the mobile app |
| EA compatibility | MT4 and MT5 use different application formats | Confirm the EA is specifically an MT5 build and appears under Expert Advisors in Navigator |
| Software trust | Untrusted EAs may request unsafe capabilities | Obtain the EA from a credible source and inspect its permissions; avoid unnecessary external code access |
| Trading symbol | Names, spreads and contract specifications may differ | Choose a symbol offered in the selected account environment; confirm its specifications |
| Available history | Missing bars or ticks can shorten or distort a simulation | Allow initial history download and inspect coverage and errors before drawing conclusions |
| Testing assumptions | Account size, leverage and inputs change the scenario | Write down the settings so that later tests can be compared fairly |
MetaTrader may download price history automatically when a test needs it. A long first run can therefore spend time retrieving ticks before calculations begin. Availability and quality depend on the source. See MetaTrader's explanation of how the tester obtains historical data.
If you plan to compare an EA with another platform, FXGlory also has a separate MT4 Strategy Tester guide. Keep each platform's results and assumptions identified instead of assuming the tests are equivalent.
If prices or real-tick records are missing, check the MT5 historical data and history-download guide before judging the test output.
How to Backtest an EA on MT5 Step by Step
The following workflow uses MT5's built-in Strategy Tester. The exact arrangement of controls may differ with platform updates, but the fields and their purposes are documented by MetaTrader.
- Open Strategy Tester. In the desktop terminal choose View → Strategy Tester or press Ctrl+R. If a task-selection screen appears, choose a single EA test rather than an optimization task.
- Select the MT5 Expert Advisor. Find the EA in the tester's program selector. Alternatively, right-click an EA in Navigator and choose Test to preselect it. If the EA is absent, check whether it is installed and compiled for MT5.
- Choose the trading symbol and timeframe. Select the currency pair or other eligible instrument and the chart period. Match the intended strategy; an EA dependent on one-minute prices should not be evaluated as though it were designed for a daily chart.
- Set the historical interval. Select a start and end date with sufficient history, ideally including different kinds of market conditions. Record the dates. The tester can shift the effective start when it needs earlier bars for indicator calculations.
- Pick the tick-generation mode. For an initial diagnostic run you might choose a faster model; for a strategy sensitive to intrabar price movement, compare against Every tick based on real ticks when suitable history is available. The modes are explained below.
- Check account and execution assumptions. Review the simulated initial deposit, currency, leverage, symbol specification and any configurable execution delay or commission assumptions. Make these consistent with the scenario you want to investigate.
- Review EA inputs. Confirm the EA's position-sizing method, risk limits, stop-loss settings, trading hours and other inputs. Save a parameter set before changing anything, so tests remain reproducible.
- Turn on visualization if useful. When available, visual mode shows entries, exits and indicators on a historical chart. It is particularly useful when testing logic or diagnosing unexpected trades, though it is not a substitute for reviewing the report.
- Click Start and wait for the test to finish. Check the Journal for missing data, invalid orders or other messages. A finished run with zero trades is not automatically proof that the EA is broken; the coded conditions may not have been met.
- Read the results, graph and logs. Compare net profit, balance and equity behavior, drawdowns, trade count, trading costs and history quality. Save the test settings and report before modifying parameters.
For a repeatable test, write down the EA version, settings, symbol, dates, tick mode, initial deposit, leverage and data source. Without those details, two apparent results may not be meaningfully comparable. MetaTrader's official Strategy Tester instructions provide the detailed interface reference.
Why visual testing helps
Visual testing can reveal whether an EA opens trades before a completed candle, manages positions in the expected order or repeatedly reacts to one signal. It is especially useful for debugging logic; it does not prove that simulated fills would match the live market. MetaTrader describes this function in Testing Visualization.
MT5 Strategy Tester Modes Explained
The tick-generation setting determines how much price movement the tester simulates between bars. A faster mode can be useful for quick checks, but may omit the intrabar sequence needed to evaluate certain order types, trailing stops or narrow price targets. There is no single model that makes every strategy reliable.
| Mode | How it models prices | Best interpreted as |
|---|---|---|
| Open prices only | Focuses EA events on the opening price of each bar | A rough, fast check for suitably coded bar-open strategies; unsuitable for many intrabar-dependent rules |
| 1 minute OHLC | Emulates four prices per one-minute bar: open, high, low and close | A faster approximation that may miss the order and detail of actual tick movements |
| Every tick | Generates simulated ticks from available one-minute history | A more detailed model, still based on constructed tick movement |
| Every tick based on real ticks | Uses available broker-supplied historical tick records rather than generating an intrabar sequence | A useful realism check when adequate tick history exists, though not proof of real-world execution outcomes |
A strategy that enters at the open of a fully completed candle may respond differently to modeling modes than a scalping-style system using intrabar stops. Compare appropriate methods and investigate discrepancies rather than selecting whichever mode produces the highest return.
For more detail on historical tick behavior, consult MetaTrader's Real and Generated Ticks documentation. The term real ticks refers to historical tick data used by the tester; it does not mean the trades were executed with real capital.
How to Read an MT5 Backtest Report
After the simulation, inspect the tester's Results and Graph views. A single net-profit figure conceals how much risk the strategy took, whether the sample was long enough and what happened to open positions during losing periods. Balance reflects realized account changes, whereas equity includes the floating effect of open positions.
| Report field | What it tells you | What to investigate |
|---|---|---|
| Total net profit | The reported financial result of simulated trades under the chosen setup | Whether all relevant trading costs and financing assumptions were represented |
| Profit factor | Gross profit divided by the absolute value of gross loss | Whether a seemingly positive ratio remains positive under less favorable assumptions |
| Equity drawdown | Decline in simulated equity from a prior high, including open-position effects | Whether open losses became much larger than closed balance losses |
| Balance drawdown | Decline measured from realized balance changes | Whether balance metrics conceal substantial floating losses |
| Total trades | Number of simulated trades | Whether the outcome depends on too few observations |
| History quality | A platform measure related to the integrity/coverage of underlying minute history | Data gaps, inconsistent records and the exact data/model used |
| Graph and Journal | Path of simulated results plus testing and EA messages | Long losing stretches, unusual jumps, missing data and execution errors |
MetaTrader defines these fields in its Testing Report reference. History quality is a data-integrity measure, not a percentage chance that the EA will reproduce its performance in live trading.
A hypothetical profit-factor check
Suppose an entirely hypothetical test reports $480 gross profit and $400 gross loss. The profit factor is 480 ÷ 400 = 1.20, and the difference is $80 before any additional costs omitted from that example. If 160 completed trades would incur an additional $0.75 per trade not accounted for in the test, the unmodeled expense would be $120, changing that illustrative $80 gain to a $40 loss. This is arithmetic, not a result from MetaTrader or an FXGlory account.
Do not subtract commissions twice: check which charges the original report already included. The lesson is that apparently modest profits may be vulnerable to unmodeled transaction costs or changes in fills.
For a detailed explanation of profit factor, balance and equity drawdown, expected payoff and History Quality, continue with our guide to reading an MT5 backtest report.
How Accurate Are MT5 Backtests?
A backtest is conditional on its inputs. Better historical coverage and an appropriate tick model help investigate a strategy, but no backtest perfectly reproduces future spreads, slippage, liquidity, connection failures or order-processing behavior. Accuracy should be evaluated by comparing assumptions with the strategy's needs—not by treating a high history-quality percentage as a guarantee.
History gaps, tick data and symbol settings
History may have missing periods, different quote sources, varying depth or a limited available date range. If an EA depends on intrabar prices, comparing generated ticks with available real-tick testing is informative. Check the modeled contract size, tick value, trade volume rules and account currency; these affect margin and reported outcomes.
Spreads, commissions, swaps and execution delay
Trading costs matter most for strategies with small expected gains per trade. Different symbols and accounts can have materially different spreads or commissions, and swaps may affect positions held overnight. In MT5, details of spread representation depend on the modeling mode and available quote data, while the tester also supports certain execution-delay and account-condition simulations. Do not assume that every cost can be corrected by typing one fixed spread into an ordinary tester field.
If a backtest changes sharply when the period, symbol assumptions, costs or tick mode change, treat that sensitivity as a warning that more investigation is necessary. Consult MetaTrader's documented test settings rather than relying on a screenshot of returns.
Backtesting vs Optimization vs Forward Testing
These three processes answer different questions. Using them interchangeably can make a strategy look more convincing than the evidence justifies.
| Approach | What it does | Main limitation |
|---|---|---|
| Single backtest | Runs one fixed EA configuration over a selected historical period | One historical sample can favor rules that later stop working |
| Optimization | Repeats historical tests over different input combinations | Selecting the best historical result can overfit the data |
| MT5 historical forward period | Tests selected parameters on a later portion of the historical period not used for their initial fitting | Still uses historical data and tester assumptions; it is not live execution |
| Demo forward observation | Runs an EA over incoming market data in a demo trading environment | More realistic for some operational checks, but demo fills and future live results can differ |
For example, selecting settings on one historical interval and checking them on a later, untouched interval helps expose strategies dependent on that first period. MT5 provides a Forward selection within the Strategy Tester for this historical split. That feature is different from leaving an EA running on a live-streaming demo account for several weeks.
Optimization is an advanced workflow and deserves deliberate treatment: more combinations can increase the risk of choosing settings that happen to fit the past. MetaTrader explains the functionality in Strategy Optimization. A stronger evaluation also asks whether reasonable nearby parameters behave similarly, rather than judging only the single best run.
When you are ready to compare EA input combinations, follow our MT5 Expert Advisor optimization tutorial for parameter selection, genetic testing and forward validation.
Common MT5 Strategy Tester Problems
If Strategy Tester does not produce expected trades or results, check the simplest causes before editing an EA or reinstalling the platform. The journal can often distinguish a software error from a test with no qualifying signals.
| What you see | Possible causes | First checks |
|---|---|---|
| EA missing from the list | Wrong program format, missing installation or compilation issue | Confirm an MT5 .ex5 build, Navigator visibility and compilation errors |
| Zero trades | Entry conditions not met, restrictive inputs, symbol/timeframe mismatch or rejected orders | Check EA rules, interval, risk settings and Journal messages |
| Test stops or cannot start | Unavailable history, invalid parameters or local agent/resource problems | Inspect Journal, history downloads and selected tester agent |
| Different results between modes | Price sequence, stops or spread assumptions are sensitive to tick detail | Keep other settings fixed and compare the modeling method |
| Missing historical period | Insufficient history or data-download limitations | Verify symbol, date range, server connection and available records |
| Unexpected losses or profit jumps | Position size, margin, symbol specifications or missed charges | Review inputs, equity curve, detailed orders and account conditions |
A message such as waiting for update can have more than one cause; check the connection, requested symbol/history and tester log rather than assuming a universal fix. Avoid indiscriminately deleting platform files based on forum advice. If a problem persists, use the official platform documentation or appropriate technical support.
How to Evaluate an EA After Backtesting
A completed run is the beginning of evaluation, not the end. Before drawing a conclusion, assess whether the EA behaves consistently when you make realistic changes to the assumptions and whether the underlying strategy is permitted for the account you intend to use.
- Repeat the same configuration: Preserve the test settings and check that results can be reproduced.
- Check separate historical periods: Investigate periods with different volatility and trends without repeatedly tuning to all of them.
- Compare reasonable modeling choices: Review how sensitive entry and stop behavior is to tick detail and historical data.
- Inspect drawdowns and exposure: Look at the equity curve, not only the closing balance or win rate.
- Use defensible trading-cost assumptions: Confirm that spread, commission, swap and execution limitations are not understated.
- Observe on a demo account: Check operational behavior on incoming prices over time. Demo observation does not establish live profitability.
- Confirm trading permissions: Make sure the EA strategy is compatible with the broker's current policies before considering real funds.
FXGlory's published conditions allow EAs on real accounts but exclude scalper, news-trader and arbitrage EAs. Confirm the current wording in FXGlory’s official EA policy and seek clarification if you cannot classify a strategy confidently. A successful historical backtest does not override the broker's restrictions. For the wider discipline of limiting exposure and sizing positions, see the forex risk management guide.
Final Checklist Before Using a Tested EA
Before interpreting a backtest as evidence worth acting on, make sure you can answer all of these questions:
- Is the EA version intended for MT5, and do I understand its strategy and risk controls?
- Did I record the symbol, timeframe, test dates, model, account assumptions and parameter set?
- Did I inspect the equity drawdown, historical data quality, trade count and Journal, not just net profit?
- Have I considered spreads, financing costs, execution differences and alternative historical periods?
- Did I distinguish an MT5 historical forward split from monitoring the EA in a demo environment?
- Have I checked whether the strategy is allowed under the broker's current trading conditions?
A good backtesting process helps you identify weaknesses before real money is involved. It does not remove market risk, and a trader should be prepared to stop an EA when its behavior differs from expectations.
Frequently Asked Questions
How do I open Strategy Tester in MT5?
In the desktop MetaTrader 5 terminal, choose View → Strategy Tester or press Ctrl+R. You can also right-click an Expert Advisor in Navigator and choose Test to select it in the tester.
Can I backtest an Expert Advisor on MT5 for free?
The built-in MT5 Strategy Tester is part of the desktop platform and can be used without purchasing a separate backtesting application. Some third-party EAs, historical data services, remote computing options or simulators may have their own costs.
Can I backtest on MT5 mobile or Android?
The native MT5 phone apps do not provide the same built-in EA Strategy Tester as the desktop terminal. Use a compatible desktop MT5 installation for EA backtesting; beware of downloads claiming to add native EA testing to the mobile app.
What is the difference between manual and EA backtesting?
EA backtesting runs coded trading rules against historical data in Strategy Tester. Manual backtesting means a person follows discretionary trading rules on historical charts or in a separate replay environment. They are different workflows.
Which MT5 testing mode should I use?
Choose a mode suited to the strategy. Open prices only and 1 minute OHLC are faster approximations, while Every tick and Every tick based on real ticks examine more detailed price movement. Where available, real-tick tests can be useful for strategies sensitive to intrabar prices, but none guarantee live results.
What does history quality mean in an MT5 backtest?
It is a platform measure of the integrity of historical minute data, including gaps and inconsistent records. It is not the probability that a backtest will be accurate in live trading or profitable in the future.
Why does my MT5 Strategy Tester show no trades?
Possible reasons include strategy conditions never being met, incompatible symbols or periods, input restrictions, incomplete data, or rejected trade requests. Check the EA rules, settings and tester Journal before assuming the software is broken.
Can I trust a profitable MT5 backtest?
A profitable historical simulation is not proof of future success. Check equity drawdown, test dates, sample size, trading costs, modeling assumptions and out-of-sample behavior, and observe a compatible EA on demo before considering live use.
Is forward testing in MT5 the same as demo trading?
No. The Strategy Tester Forward option evaluates parameters on a later historical segment. Running an EA on a demo account uses new incoming prices and may reveal additional operational issues. Neither process guarantees future live performance.
Related Contents
Explore MetaTrader 5 with FXGlory
Register with FXGlory to access the client cabinet and explore available MetaTrader platforms and demo options. Historical tests and demo observation can help you investigate an EA, but neither removes the risks of live forex trading. Review current EA restrictions before using any strategy with real funds.
Register with FXGlory