Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
935
Rating:
(36)
Published:
2025.04.04 10:53
\MQL5\Experts\fxsaber\ \MQL5\Include\fxsaber\MultiTester\
Settings.mqh (1.35 KB) view
String.mqh (1.29 KB) view
Task.mqh (7.66 KB) view
MultiTester.mqh (4.74 KB) view
MTTester.mqh (120.02 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

There are times when you need to run the Expert Advisor on multiple symbols. For this purpose there is a mode "All symbols selected in the Market Watch window" in the MT5-tester. This allows you to run the same EA settings on different symbols.


But sometimes you need to make many different runs of MT5-tester. This library allows you to do it.


Features.

You can set any number of combinations of symbols, timeframes, intervals. And conduct not only single runs on them, but also optimisation, including forward.


Scenarios.

  • Research on which symbols and/or intervals and/or timeframes the TS shows good results.
  • Performing optimisations on consecutive intervals in order to evaluate the auto-optimisation prospects of the TS.


Usage.

We configure MT5-Tester as we need.

The picture shows that Optimisation will be carried out by full brute force on real ticks at a certain interval.


Create a list of required optimisations. For example, you can run an Expert Advisor from the delivery of this library.

With the settings as shown in the picture, it will run optimisation on all symbols from the Market Watch, and for each symbol it will optimise on M1 and M15 timeframes.


The result will be like this


And now you can safely see the results of optimisation using the standard MT5-tester tools.


Programming.

Example1.

Let's consider a very simple example first.

    #include <fxsaber\MultiTester\MultiTester.mqh> // Multiple runs/optimisations in Tester.
    
    // This function is responsible for generating the task list.
    void SetTesterSettings()
    {
      TesterSettings.Add("AUDCAD"); // Run AUDCAD with the settings specified in the Tester.
      
      TesterSettings.Add("EURUSD", PERIOD_H1); // Run EURUSD H1 with the settings specified in the Tester.
      
      TesterSettings.Add("GBPUSD", PERIOD_M6, D'2019.07.01', D'2019.09.01'); // Run GBPUSD M6 on the specified interval.
    }

    The result of running this EA will be three calls of the Tester with the settings that are read in the source code.


    Example2.

    Let's analyse the source code of the Expert Advisor, the demonstration of launching which is given in the beginning.

    #include <fxsaber\MultiTester\MultiTester.mqh> // Multiple runs/optimisations in Tester.
    
    sinput bool Period_M1 = false;         // Switch on M1
    sinput bool Period_M5 = false;         // Switch on M5
    sinput bool Period_M15 = false;        // Switch on M15
    sinput bool  false; // Custom characters only
    
    // This function is responsible for generating the task list.
    void SetTesterSettings()
    {
      // Search all symbols from the Market Watch.
      for (int i = SymbolsTotal(true) - 1; i >= 0; i--)
      {
        const string Name = SymbolName(i, true);
    
        if (!OnlyCustomSymbols || SymbolInfoInteger(Name, SYMBOL_CUSTOM))
        {
          if (Period_M1)
            TesterSettings.Add(Name, PERIOD_M1); // If M1 is set, add each character with this TF.
    
          if (Period_M5)
            TesterSettings.Add(Name, PERIOD_M5); // If M1 is set, add each character with this TF.
    
          if (Period_M15)
            TesterSettings.Add(Name, PERIOD_M15); // If M15 is set, add each symbol with this TF.
    
          if (!Period_M1 && !Period_M5 && !Period_M15) // If no TF is set, let's run the Expert Advisor on the TF.
            TesterSettings.Add(Name);
        }
      }
    }

    The second example generates a list of tasks based on the marked TFs and symbols in the Market Watch. Again, let's look at the comments in the source code.


    So, all we need to do is to write this string

    #include <fxsaber\MultiTester\MultiTester.mqh> // Multiple runs/optimisations in Tester.


    and write only one function that generates tasks in an intuitive way.

    // This function is responsible for generating the task list.
    void SetTesterSettings()


    Features.

    • Requires permission to use a DLL. Several WinAPI functions from user32.dll are called. Therefore not suitable for Market unless bypassed.
    • The MTTester.mqh file in the delivery contains methods of MT5-tester control, which are convenient to use in other projects.
    • It is possible to resume a task from an interrupted place.

    Translated from Russian by MetaQuotes Ltd.
    Original code: https://www.mql5.com/ru/code/26132

    Pan PrizMA No leverage 72 Pan PrizMA No leverage 72

    Construct a moving line with a polynomial of 4 degrees. Extrapolates the sinusoidal and its axial. The constructed lines remove one value at each bar and a sliding line of extrapolated values is constructed which is not redrawn.

    MA Trend 2 MA Trend 2

    Trading system by iMA indicator (Moving Average, MA). Development of MA Trend.

    Display optimised for console-type chart text output Display optimised for console-type chart text output

    This library allows you to create displays to easily output text information to the chart at the most optimal rate

    Manual Position Tracking Panel Manual Position Tracking Panel

    Panel based on CDialog class. Work on the current symbol. Deleting, setting Take Profit, setting Breakeven on a group of positions

    This website uses cookies. Learn more about our Cookies Policy.