MultiTester - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources








Sometimes you need to run an Expert Advisor on multiple symbols. For this purpose, there is a "All symbols selected in the market quote window" mode in the MT5 tester. This allows you to run the same EA settings on different symbols.
But sometimes you need to run different MT5 test programs multiple times. This library allows you to do just that.
You can set up any number of combinations of trading instruments, time ranges, and intervals. Not just a single run of them, but also optimization, including forward.
We configure MT5-Tester as needed.
The figure shows that the optimization will perform a full brute force attack on real ticks at certain intervals.
Create a list of required optimizations. For example, you can run an Expert Advisor through the library's delivery.

With the settings shown in the picture, it will run the optimization for all symbols in the market ticker, and for each symbol it will optimize on the M1 and M15 timeframes.
The result will be like this
Now you can safely view optimization results using standard MT5 testing tools.
Let's first consider a very simple example.
#include//Multiple runs/optimizations in the tester. // This function is responsible for generating the task list . Blank SetTester setting() { Tester Settings.Add( "AUDCAD" ); // Run AUDCAD using the settings specified in the tester. Tester Settings.Add( "EURUSD" , PERIOD_H1 ); //Run EURUSD H1 using the settings specified in the tester. Tester settings.Add( "GBP/USD" , PERIOD_M6 , D'2019.07.01' , D'2019.09.01' ); // Run GBPUSD M6 at specified intervals. }
The result of running this EA will be three calls to the tester with the settings read in the source code.
Let's analyze the source code of EA trading and give a startup demonstration at the beginning.
#include// Run/optimize multiple times in tester . Input boolean period_M1 = false ; // Turn on M1 Input boolean period_M5 = false ; // Turn on M5 Input boolean period_M15 = false ; // Turn on M15 Input boolean error ; // Custom characters only // This function is responsible for generating the task list. Blank SetTester setting() { // Search all trading symbols from Market Watch. for ( integer i = total number of symbols ( true ) -- 1 ; i >= 0 ; i - ) { const StringName = SymbolName (i, true ); if (!OnlyCustomSymbols || symbol information integer (name, SYMBOL_CUSTOM )) { if (period_M1) TesterSettings.Add(name, PERIOD_M1 ); // If M1 is set, add each character to this TF. if (period_M5) TesterSettings.Add(name, PERIOD_M5 ); // If M1 is set, add each character to this TF. if (period_M15) TesterSettings.Add(name, PERIOD_M15 ); // If M15 is set, add each symbol to this TF. If (!Period_M1 && !Period_M5 && !Period_M15) // If TF is not set, we run Expert Advisor on TF. TesterSettings.Add(name); } } }
The second example generates a task list based on tagged TFs and symbols in Market Watch. Again, let's look at the comments in the source code.
So, all we need to do is write this string
#include//Multiple runs/optimizations in the tester.
Just write a function that generates tasks in an intuitive way.
// This function is responsible for generating the task list. Blank SetTester setting()
Attachment download
📎multitester_example.mq5 (1.18 KB)
📎 multitester_example2.mq5 (0.62 KB)
📎 settings.mqh (1.35 KB)
📎 string.mqh (1.29 KB)
📎 task.mqh (7.66 KB)
📎 testersettings.mqh (3.05 KB)
📎 multitester.mqh (4.74 KB)
📎 mttester.mqh (120.02 KB)
Source: MQL5 #26132
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •