You are going to learn how to backtest an expert advisors in this tutorial. The platform used here is the MT4 strategy tester.
The main purpose of backtesting is to show you whether your trading ideas are valid.
Backtesting should be at the forefront of considerations before buying to using any forex robot.
Although you can backtest expert advisors on other trading platforms like tradingview as well, it is more efficient and easier on MT4.
You use past market data to see how a strategy would have performed.
If the strategy looks like it has potential, it may also be effective in a live trading environment.
Why backtest Expert Advisor or Robot?
For many reasons, backtesting with a robot is almost seamless.
The use of manual or paper backtesting usually comes with a barrage of drawbacks.
Whether its unavailability of sufficient data, the level of awareness it demands, or how cumbersome it can be.
The truth is, the world is moving towards automating everything in order to eliminate these drawbacks and other numerous drawbacks for that ‘’ease’’ we all crave.
Call it artificial intelligence or whatever you want to, automation is the new oil, and it’s here to stay so it’s only normal we see it finding its way into finance and other ecosystems.
How to backtest Expert Advisor (Video)
Backtesting an expert advisor usually requires two major things; your strategy tester and your pre-historic data.
To properly carry out a thorough backtest, you need at least 10 years’ worth of data. Getting 10years of data might sound intimidating but, it’s basic.
Here’s how you do it on Metatrader4 & 5:
1. Locate the history center

2. Click on FX Majors

3. Click on the currency pair of your choice

4. Click and download all the timeframes

After you have completed all these commands, you should have up to 2 years of data at your fingertips.
With this amount of information, you should be able to confidently carry out a competent and accurate backtest.
Now, you might even need more data.
In cases where you feel like 2 years is not enough backlog to backtest a currency pair on, then you can actually increase the amount of data to the level you want.
5.Click on tools > Options

6. Once you click on options, this text box should pop up

In front of the text boxes that say max bars in history and Max bars in the chart, add as many zeros as possible.
Then you can now scroll to your tools and history center and redownload all data timeframes again.
When you do this, you increase the amount of prehistoric data you’re able or allowed to download.
Without doing this, you would only be able to download a max of 2 years and a minimum of 10 months of data.
This data is the basis of backtesting an expert advisor for all the obvious reasons.
In order to know how good a strategy would perform in the future; you have to know how it would have performed in the past.
Without this sort of analysis or information, it’s impossible to make an insightful decision when it comes to implementing a new trading strategy or expert advisor.
Implementing a new expert advisor or strategy on a live account without actually carrying out a competent backtest would most likely lead to several losses and eventually wasted capital.
Here’s a video tutorial on how to start and finish backtest
Strategy tester
Strategy Tester is designed for testing and optimizing trading robots before using them in real trading.
It is based on historical quote data.
During the test, a trading robot analyzes available quotes performing virtual transactions in accordance with its algorithm.
This allows you to evaluate how the Expert Advisor would have traded in the past and simulate its behavior in real trading.


Steps on using Strategy Tester to Backtest a Forex Robot
1. After clicking strategy tester this dialogue box would pop up.
To the top left of the strategy tester dialogue box, there is a toggle option that contains < Expert Advisor > & < Indicator>.
Select the” Expert Adviser> option accordingly.
2. Right beside the < Expert Advisor> toggle option, there should be a dropdown list of the type of EA you want to backtest.
For this illustration, we’re using an EA called MACD simple EA.
3. The <Symbol> drop-down list contains a list of currency pairs.
Select the currency pair you downloaded historical data for.
In this case, I downloaded data for EURUSD.
4. Right under the <symbol> drop-down, another dropdown titled <model> would be in sight. It contains three options:
a) Every tick (the most precise method based on all available least timeframes to generate tick)
b) Control point (a very crude method based on the nearest least timeframe. The result must not be considered)
c) Open price only (Fastest method to analyze the bar just completed)
For a close to live trading experience the best model is the” Every tick” mode.
This is because of how quickly it reacts to the price action.
Another good model is the “Open price only” model.
This model focuses on the opening and closing of each candlestick.
Although its function varies according to the type of program or EA you’re using.
5. Check the” use date” option and proceed to enter the timeframe you want to backtest.
6. To be able to have a visual of what the EA is currently doing, click on the <Visual mode> option.
It shows you the open and close of each order.
7. Choose a timeframe Favorable to you. In this article, we’re focusing on a 1 Hour timeframe.
8. Pay keen attention to the option contained in the dialogue box titled < Expert properties>.
It contains details about the Expert Advisor.
Click on it.
Then move your cursor to the input column and make the adjustments that you want.
So, therefore, I am going to be raising my take profit to 100, my lot size to 0.1, and my trailing stop to 30.00.
Faqs on Expert Advisor Backtetsing
What Is The Cost Of A Forex Robot?
The cost of buying a forex trading robot depends on certain factors, but keep in mind that the cheapest ones are cheap for a reason.
If a service costs less than $100, you should take extra precautions to research it and ensure that it is a better deal than more expensive services.
How Does One Go About Developing A Forex Trading Robot?
To build a forex trading robot, you’ll need access to the trading software’s application programming interface (API). This service is not available at all brokerages.
Once you’ve accessed the API and programmed your trading robot, you’ll need to devise a strategy.
This entails identifying profitable trading signals and backtesting them to ensure consistency. After that, all you have to do is connect the dots and tell the trading API what to do when those trading signals are triggered.
I offer expert advisor building and programming here, you can check that out.
Which Metatrader 4 Elements Can Traders Use For Backtesting?
Since you now understand the basics of how to backtest a forex robot, it’s important to note that it’s possible to backtest several other elements on MT4.
The software comes with two elements – Expert Advisors and indicators – that can be used for automated backtesting. While I discussed how to backtest EA, this method is also applicable to indicators in a similar manner.
After entering all of the necessary prerequisites, the EA backtesting software will automatically backtest the indicators. However, this does not preclude traders from manually testing their strategies.
They can certainly do so, but it will take much longer and involve many more steps than automatic backtesting.
Conclusion – How to Backtest Expert Advisor
Indeed, Backtesting is easy, efficient, and absolute for huge sets of data.
With the help of a Forex robot, you can open trades, close trades, manage risks and backtest while on an errand or doing something else.
It is truly an advanced Forex innovation we should all be grateful for.
Leave a Reply