The built-in MetaTrader 5 Strategy Tester facilitates the testing of automated robot performance in trading. This powerful tool not only allows testing the efficiency of an Expert Advisor, but also allows detecting the best input parameters before you run the EA on your real account.
The entire operation of the Strategy Tester is based on historical quotes of currencies, stocks and other assets. During testing, the Expert Advisor goes through the accumulated quotes and performs virtual transactions according to its algorithm. This procedure allows an evaluation of how the EA would have traded in the past.
MetaTrader 5 Strategy Tester offers several testing modes to achieve the optimal speed/quality ratio based on trader’s needs. “Every tick” is used to ensure the best testing accuracy. Simulated conditions are the most realistic in this mode. “1 minute OHLC” is introduced for traders who want to test a strategy quickly but also accurately at the same time. Select “Open prices only” if you need very quick and rough estimation based on bars’ open prices.
The Strategy Tester is not only used for the testing of the trading robots, but it is also used to solve many mathematical problems involving parameter optimization. In this case trading history is not used and the market environment is not simulated giving way to math calculations implemented in the Expert Advisor.
With stress testing, the testing of trading robots can be even more realistic. Random Delay mode simulates network delays when transferring and processing trading requests, as well as delays of requests execution by dealers in real trading.
Display of Expert Advisors’ test results is one of the most notable features of the Strategy Tester. The results are shown in figures displaying an Expert Advisor’s profit during a test. Additionally, they are also represented by a great amount of statistical data including profit/loss percentage ratio, number of profitable/loss-making deals, risk factor, expected payoff and much more.
Strategies testing results can be presented in charts for more convenient analysis.
Visual testing makes it possible to track an Expert Advisor’s operations on historical price data in real time:
The visualization mode allows the trader not only to monitor the trading robot’s operation in real time, but it additionally allows the testing of custom technical indicators. For example, you can evaluate an indicator’s behavior on historical data before buying it from the Market.
Another important utility of the Strategy Tester is the function of optimization, which allows choosing the best input parameters for a specific trading robot. For instance, with optimization, you can modify the parameters to achieve maximum profitability and stability, minimum risk and so forth.
The number of combinations of input parameters in the optimization can be overwhelming: you can have up to hundreds or even thousands of such combinations. As a result, the optimization can turn into a very extensive process, but still can be significantly shortened through the use of genetic algorithms. This feature disables the serial search of all combinations of input parameters and selects only those that best meet the optimization criteria set. In subsequent phases, the “optimal” combinations are crossed until the best possible result is achieved. The genetic algorithms help to considerably reduce the number of combinations and the total optimization time.
The Strategy Tester provides powerful 2D and 3D tools for visual analysis of optimization results. For example, you can analyze correlation of a final result with two parameters in 2D, while 3D allows you to view the entire process of the optimal result search during optimization.
The built-in forward testing option helps avoid the problem of “over-optimization” or parameter fitting. This option divides the database of currency and stock quotes for optimization into two separate parts. The optimization is performed for the first part, while the second part is used to confirm the obtained results. If a trading robot is equally efficient on both segments, this is the proof that the trading system has the best parameters, and parameter fitting is practically impossible.
Distributed testing and optimization allows the connection of additional computing resources in order to enhance these processes. For example, you can use additional computers in your local network to accelerate the optimization process. But that is not all.
MQL5 Cloud Network is a cloud computing network that unites thousands of computers from all over the world. The Strategy Tester can connect to the network benefiting from almost unlimited computing power. With the MQL5 Cloud Network, the optimization of trading applications, which would normally take months to compute if using only one computer, can now be completed within a few hours.
In addition to using the distributed computing network, you can provide your CPU computing power and earn money. You should launch the MetaTester component included into the MetaTrader 5 trading platform and your computer will be connected to the MQL5 Cloud Network.
The Strategy Tester is an extraordinary powerful tool crafted for developers of trading robots. Without the use of the tester, the creation of an efficient and reliable robot is practically impossible. The Strategy Tester saves you lots of time and allows creating a truly optimal trading robot!