Strategy Tester in the MetaTrader 5 Terminal
To test how an Expert Advisor can perform in trading, the built-in Strategy Tester is available in MetaTrader 5. This powerful tool allows testing the efficiency of an Expert Advisor and detects the best input parameters before it is used for real trading.
The entire operation of the Strategy Tester is based on historical data. During testing, the Expert Advisor goes through the accumulated quotes and analyzes them one by one. At the same time the EA performs virtual transactions in accordance to its algorithm. This allows simulation of the price dynamics and assess how the EA would have traded in the past.
The MetaTrader 5 Strategy Tester allows testing EAs on multiple currencies. Expert Advisors have access to all the financial instruments in the tester and can perform trading transactions with any of them. This feature allows you to test even more sophisticated Expert Advisors that are capable of analyzing multiple currencies and identify the correlation between them.
The main advantage of testing is the possibility to evaluate a robot performance prior to trading on a real account. In addition, it takes only a few minutes in the tester rather than days, weeks or months needed to test an EA in the real market. This is an indisputable advantage of the Strategy Tester, but not all of its capabilities.
Another important utility of the Strategy Tester is the function of optimization, which allows choosing the best input parameters for a specific Expert Advisor. For example, with optimization, you can modify the parameters to achieve maximum profitability, maximum stability, minimum risk and so on.
During the optimization process one Expert Advisor is tested multiple times with different sets of parameters. After optimization, comparison of the results of all tests is possible, which allows selecting the parameters that provide the best performance of a robot.
The number of combinations of input parameters in the optimization can be quite large, up to hundreds or even thousands. As a result, the optimization can turn into a very extensive process, but still can be significantly shortened.
First, the tester supports genetic algorithms. This feature disables the serial search of all combinations of input parameters and selects only those that best meet the optimization criteria. In subsequent phases, the "optimal" combinations are crossed until the results stop improving. Thus, the number of combinations and the total optimization time are considerably reduced.
Second, distributed testing and optimization provide for the possibility to connect additional computing resources to enhance these processes. For example, you can use additional computers in your local network to accelerate the optimization process. This resource helps so that the time for optimizing sophisticated Expert Advisors in the MetaTrader 5 Strategy Tester is significantly reduced.
The built-in forward testing helps avoid the insidious problem, which is usually called "over-optimization" or parameter fitting. This option divides the base for optimization into two parts. The optimization is performed for the first part, while the second part is used to confirm the obtained results. If Expert Advisor is equally efficient on both segments, this is the proof that the robot has the best parameters and parameter fitting is practically impossible.
The Strategy Tester is an indispensable tool for developers of Expert Advisors. It is practically impossible to create an efficient and reliable robot without this exciting tool. The tester saves lots of time and allows creating a truly profitable Expert Advisor.