A trading robot can show a rising profit curve and still take risks you would never accept. Before asking how much it made, ask what the account had to endure to get there. That is the useful purpose of MT5 backtesting: understanding an Expert Advisor under defined conditions before considering live use.
The short answer: test with suitable historical data and fixed settings, check execution costs and drawdown, then evaluate an untouched period and follow the robot on a demo account. Historical performance is not a promise of future returns.
What a backtest can—and cannot—tell you
A backtest applies a robot’s rules to past prices. It can reveal programming problems and show how entries and exits behave. It cannot reproduce every live condition: connectivity, liquidity and execution quality can change the outcome.
Separate software testing from strategy evaluation. An EA may follow its instructions perfectly while the underlying idea remains unreliable. If you are still choosing a tool, start with what MT5 forex robots actually do before comparing reports.
Write down your settings before you start
- Robot name, version and the input settings file.
- Broker and exact symbol, including any suffix.
- Timeframe, date range, starting deposit and account currency.
- Position-sizing method, trade limits and simultaneous exposure.
- Commission, swaps, spread and execution assumptions to review.
This small record prevents misleading comparisons. Increasing lot size alone can raise both profit and drawdown. That does not necessarily mean the strategy has improved.
How to backtest an Expert Advisor in MT5
- Open the desktop terminal. In Navigator, right-click the EA and select Test.
- Select the robot, symbol, timeframe and dates, then review Inputs.
- Choose a suitable price model. Every tick based on real ticks uses the broker’s available tick history; inspect the journal for missing or inconsistent data.
- Set the deposit, leverage and execution-delay assumptions for your test scenario.
- Run the test, then inspect its trades and journal before interpreting the report.
The official Strategy Tester guide explains the settings. MetaTrader also documents real and generated ticks. A more detailed model does not remove the need to check data quality.
Read beyond net profit
| Measure | Question to ask |
|---|---|
| Equity drawdown | Do open losses tell a different story from closed-trade balance? |
| Profit factor | Is the outcome spread across many trades or dominated by one outlier? |
| Trade count | Is the sample meaningful for the strategy, or based on only a few opportunities? |
| Losing streaks | Could you follow the rules through a weak period? |
| Distribution of results | Does success depend on one month or market session? |
Profit factor divides gross winning profit by the absolute value of gross losses. Equity reflects open positions; balance reflects realised account operations. Consult the official testing-report definitions when comparing similarly named metrics.
A worked example: identical profit, different experiences
Imagine two hypothetical tests that each start at 10,000 and finish with 1,200 net profit. In the first, equity falls from a peak of 10,500 to 9,450: a 10% decline from that peak. In the second, it falls from 11,000 to 7,700: a 30% decline. The final profit hides a substantial difference in the path taken.
These are illustrative figures we created, not product results or a suggested account size. There is no universal acceptable drawdown, and no single metric can establish whether a robot is suitable.
Use an untouched period, then a demo account
Keep some data out of the settings-development process. If you repeatedly adjust the robot after seeing that period’s results, you have turned it into development data too. The tester’s Forward option separates a historical period for checking selected settings. That is different from observing a robot on a demo account as new prices arrive.
During demo observation, record expected versus actual behaviour: signal time, execution time, position size, exit reason and any error message. The end-of-week balance is not enough. Our MT5 VPS hosting guide explains the operational side of keeping a terminal running. Hosting cannot repair a weak strategy.
Mistakes that make a report look better than reality
- Showing only the strongest period and hiding difficult ones.
- Increasing lot size after losses without examining exposure.
- Ignoring costs or assuming ideal execution throughout.
- Changing several inputs together, obscuring the cause of any improvement.
- Judging by win rate without examining the size of losses.
If you want your rules turned into an EA, define the test criteria before requesting custom MQL5 development. Ask how entries, exits and rejected orders are handled, rather than requesting only a profit report.
Frequently asked questions
Does a good backtest guarantee profit?
No. It describes past behaviour under particular assumptions. Markets and execution can change, and settings may have been fitted too closely to historical data.
How many years should I test?
There is no magic duration. Consider market variety, data quality and a meaningful number of opportunities for the strategy. A busy month may say little about a long-term system.
Should I start with gold or currencies?
Use the instrument the rules were designed for. Moving settings between instruments without checking contract specifications and costs can produce misleading comparisons.
When should I reject a result?
Pause when you cannot explain or reproduce it, when material errors appear in the journal, or when modest, reasonable changes to assumptions make the outcome collapse. Investigate before considering real capital.
Your next step: save one report with its settings and repeat it after changing a single factor. An organised comparison is more useful than dozens of reports with unknown differences. You can browse Pips Robot trading tools and review each tool’s purpose and requirements before testing.
This is technical and educational content, not investment advice. Forex and gold trading involve the risk of losing capital.



