Libraries: MultiTester - page 49

 
fxsaber #:
Are you sure you are using the current version of MTTester.mqh? The following code is there.

I remember I updated to the latest version, but I don't know why I missed updating that file. Everything works fine now.

 
Добрый день!

Перестал компилироваться прилагаемый скрипт.
Выдается ошибка:
parameter convertion type 'short[260]' to 'ushort[] &' is not allowed MTTester.mqh 156 39
   int user32::GetClassNameW(long,ushort&[],int) winuser.mqh 1414 37

Может быть что-то нужно поменять в MTTester.mqh ?

Ранее он прекрасно компилировался.

Не могли бы помочь?

С уважением, Александр
Files:
_Noc.mq5  62 kb
 
klycko #:
The attached script stopped compiling.

Forum on trading, automated trading systems and testing trading strategies.

Libraries: MultiTester

fxsaber, 2025.06.08 16:57

From KB I download sources only by clicking on the corresponding file, as in the picture.

I just downloaded it in this way to check - compiled without errors.

 
fxsaber #:

Thank you very much!

Everything works again!

 

Downloaed as shown in the above image but error in cmopile

Mttester.mqh compiled error pls check for new build MT5 V5 BULD 5142 


ERRROS : 


parameter convertion type 'short[260]' to 'ushort[] &' is not allowed MTTester.mqh 135 39

'ReadFile' - no one of the overloads can be applied to the function call MTTester.mqh 1283 21


 
dave365 #:

Downloaed as shown in the above image but error in cmopile

Forum on trading, automated trading systems and testing trading strategies

Libraries: MultiTester

fxsaber, 2025.06.12 14:55

The size of the current version of the MTTester.mqh file is currently 123,822 bytes.

 

Hi @fxsaber

I hope you are doing good.

Following your work on the multitester. I read the examples and the the description of the library on how to use it but im not able to know how it will be used.

As I have the EA which i have written to test/optimize an inidcator over 9 symbols. I implemented the code as following in an EA.

//+------------------------------------------------------------------+
//|                                              MultiTesterBase.mq5 |
//|                                  Copyright 2025, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"

#include <fxsaber\MultiTester\MultiTester.mqh>

#define EA_NAME "IndicatorTesting\\EAs\\ash_indicator_testing.ex5"

// this function is responsible for generating list of tasks
void SetTesterSettings()
{
   TesterSettings.Add(EA_NAME, "EURUSD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "AUDNZD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "EURGBP", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "AUDCAD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "CHFJPY", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "CADSGD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "BTCUSD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "XAUUSD", PERIOD_CURRENT);
   TesterSettings.Add(EA_NAME, "US500", PERIOD_CURRENT);
}
//+------------------------------------------------------------------+

but i don't know what to do after it as i want to optimize the parameters against the given symbols, in tester i had to select the ash_indicator_testing ea, cause if i don't do so i wont be having the optimization parameters. After doing so i applied the above pasted code snippet i.e. (multitester ea) onto chart! Is it the right course of action or im doing it wrong? cause i wasnt able to find enough information on usage.

Please guide me on this. 

Best Regards

 
Hafiz Tamur Ahmed #:

Please direct me

Historically, MultiTester.mqh is not used for writing interactions with Tester, as it uses an event model, which is too complex. So right away I recommend using a different approach - via MTTester.mqh.


Here is a good example.

Forum on trading, automated trading systems and testing trading strategies.

Libraries: MultiTester

fxsaber, 2024.01.17 12:13 AM

#include <fxsaber\MultiTester\MTTester.mqh>    // https://www.mql5.com/en/code/26132

#define _CS(A) ((!IsStopped()) && (A))
#define  PAUSE 200

void Run( const string Settings )
{
  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);

  MTTESTER::CloseNotChart();
    
  if (_CS(MTTESTER::SetSettings2(Settings)))
    MTTESTER::ClickStart(false);

  while (_CS(!MTTESTER::IsReady()))
    Sleep(PAUSE);
}

void OnStart()
{
  string Settings[] = {"[Tester]\n" +
                       "Expert=Input_String_Example_Alternative.ex5\n" +
                       "Symbol=EURUSD\n" +
                       "Period=M1\n" +
                       "Optimization=2\n" +
                       "Model=4\n" +
                       "FromDate=2023.01.01\n" +
                       "ToDate=2024.01.01\n" +
                       "ForwardMode=0\n" +
                       "Deposit=1000000000\n" +
                       "Currency=USD\n" +
                       "ProfitInPips=1\n" +
                       "Leverage=100\n" +
                       "ExecutionMode=0\n" +
                       "OptimizationCriterion=6\n" +
                       "[TesterInputs]\n" +
                       "inAmount=1||1||1||10||N\n" +
                       "inCount=2||2||1||20||N\n" +
                       "inPeriod=3||3||1||30||N\n" +
                       "inKoef=4.56||4.56||0.456000||45.600000||N\n" +
                       "inLog=7.89||7.89||0.789000||78.900000||N\n" +
                       "inFlag=true||false||0||true||N"
                      };

  for (uint i = ArraySize(Settings); (bool)i--;)
    Run(Settings[i]);
}

Tester settings are saved via CTRL+C/V. You can save them to separate files and then fill the Settings[] array in the source above with data from them.


Additional example.

Optimize EA over a time window
Optimize EA over a time window
  • 2025.06.30
  • Maker
  • www.mql5.com
Is it possible to make the Strategy Tester to Optimize EA running it automatically multiple times over a range of time windows...
 

Thanks for the reply but im not able to understand the implementation in controller EA, like how it should be implemented and how it should be used! applying on chart or be used in tester. Because i have been reading the forum but i haven't seen any pop up appear or anything of that sort the only thing that happend on my side when i applied the controller EA onto my chart is a line stating waiting for the tester and for what is being carried out, and the strategy tester below consistently flickering. i was not able to do anything with tester!

Would be greate if a complete end to end guide is provided in the library docs so that it will be easy for new comers like me to understand and implement things according to their scenarios!

Best Regards

CC: @fxsaber

 
Getting the number of ticks in a calendar month in a non-standard way.
#include <fxsaber\MultiTester\MTTester.mqh> // https://www.mql5.com/en/code/26132

#define  PRINT(A) Print(#A + " = " + (string)(A));

void OnStart()
{
  MqlTick Ticks[];
  
  // Number of ticks for a calendar month by state method.
  PRINT(CopyTicksRange(_Symbol, Ticks, COPY_TICKS_ALL, D'2025.08.01' * 1000, D'2025.09.01' * 1000 - 1));
  
  // The number of ticks per calendar month in a non-standard way.
  PRINT(MTTESTER::GetAmountFileMonthTicks(D'2025.08.01'));
}


Result.

CopyTicksRange(_Symbol, Ticks, COPY_TICKS_ALL, D'2025.08.01' * 1000, D'2025.09.01' * 1000 - 1) = 10820615
MTTESTER::GetAmountFileMonthTicks(D'2025.08.01') = 10820615