Forex for Beginners

How to test trading robots on the MT4 platform

How to test trading robots on the MT4 platform

For those who enjoy analyzing the trading potential of trading bots on the MetaTrader 4 platform, there is a strategy tester where you can conduct tests on any expert advisor and see how it traded (virtually traded) on historical data for a specific period with defined parameters.

Let's discuss the accuracy of testing a forex robot using a specific example. For the test, we'll choose the expert advisor "Pips Snatcher EA" and run a test on the MetaTrader 4 platform. You can learn how to install a trading bot in MT4 in an article through this link. Now, let's imagine that this bot is already installed in our MetaTrader terminal, and we want to assess its profitability for the period 2020-2023.

strategy-tester-report

Step 1 – determine which currency pairs and timeframes the expert advisor trades on

So, first and foremost, we need to familiarize ourselves with the key features of the Pips Snatcher EA expert advisor, specifically – the timeframe it operates on and the currency pairs it trades. According to the description of this bot, it trades on the M15 timeframe and on the currency pairs AUDCAD, NZDCAD, and AUDNZD.

To conduct a proper test of the expert advisor, we need to download tick data for the currency pair on which we plan to test Pips Snatcher. For example, let's say we want to test this bot on the AUDCAD currency pair, M15 timeframe. Okay, now that we've determined how and what exactly we will be testing, let's proceed to download the historical quote data.

pips snatcher ea

Step 2 – download the tick history of quotes for the desired currency pair

Go to the “tools” section and select “History Center” from the drop-down menu.
In the window that opens, we find the AUDCAD currency pair on the quotes of which we wanted to test the expert advisor, double-click on it and after the time frame selection becomes available, download quotes for M1, M15 and M15 in turn.

Note - even though you will be testing on the M15 timeframe, you need to load all timeframes from M1 to M15. It’s all about building a tick history in the MT4 platform for the correct loading of which you need to load the entire available data array from different timeframes.

Step 3 - setting up the MT4 Strategy Tester

We select the expert advisor we want to test (in our case it is Pips Snatcher

We select the currency pair on which we want to test (in our case it is AUDCAD)

We select the timeframe on which we want to test (in our case it is M15)

Selecting a testing model “Every tick”

We select the time period in which we want to do the test (as we wrote above, this is the period from 2020 to 2023)

If you are testing on a weekday (working) day, then the spread size must be set to “Current”. If you are testing the Expert Advisor on the weekend, then specify the spread size as “10”

Set the amount of virtual capital on which you want to test the expert advisor.

If necessary, change the parameters in the manual settings of the advisor. For example, we want to see how Pips Snatcher will perform with maximum trading risk.

Step 5 – testing

Click the “Start” button and wait for your MT4 strategy tester to start testing the bot. And switch to the “Graph” tab, which will soon begin to display a graph of the profitability of your expert advisor’s virtual trading. 

We made a video showing how this profitability graph grows in the strategy tester. Check it out below: