Problems with multicurrency testing on MT5

 



I'm trying to do the first tests with my new multicurrency EA, but the tester makes an error and the test doesn't start. The mistake is this. Basically, I'm trying with only two currencies and there is a problem loading the second currency indicator. Where did I go wrong?


2020.05.01 21:45:25.428 AUDUSD: history synchronized from 2019.01.02 to 2020.04.30

2020.05.01 21:45:25.886 AUDUSD,M15: history cache allocated for 33013 bars and contains 30956 bars from 2019.01.02 00:00 to 2020.03.31 23:45
2020.05.01 21:45:25.886 AUDUSD,M15: history begins from 2019.01.02 00:00
2020.05.01 21:45:25.887 2020.04.01 00:00:00   cannot load indicator 'Moving Average' [4801]
2020.05.01 21:45:25.887 2020.04.01 00:00:00   Errore durante la creazione dell'indicatore MA2
2020.05.01 21:45:25.887 tester stopped because OnInit returns non-zero code
2020.05.01 21:45:25.887 log file "C:\Users\Windows\AppData\Roaming\MetaQuotes\Tester\6C3C6A11D1C3791DD4DBF45421BF8028\Agent-127.0.0.1-3000\logs\20200501.log" written

2020.05.01 21:45:25.889 test Experts\FOURHORSE\prova3.ex5 on EURUSD,M15 thread finished


//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit()
  {
     
   Highest_PercentLig1 = CurPercentLig1();CurSL_PercentLig1 = StopLossLig1;
   
   //+------------------------------------------------------------------------------

   Symbol1= (FatherCurrency1==""?_Symbol:FatherCurrency1);
   Symbol2= (DaughterCurrency1==""?_Symbol:DaughterCurrency1);
   Symbol3= (FatherCurrency2==""?_Symbol:FatherCurrency2);
   Symbol4= (DaughterCurrency2==""?_Symbol:DaughterCurrency2);
   Symbol5= (FatherCurrency3==""?_Symbol:FatherCurrency3);
   Symbol6= (DaughterCurrency3==""?_Symbol:DaughterCurrency3);
   Symbol7= (FatherCurrency4==""?_Symbol:FatherCurrency4);
   Symbol8= (DaughterCurrency4==""?_Symbol:DaughterCurrency4);

   handle1= iMA(Symbol1, Timeframe, MA_Period,0,MA_Method, MA_Price);
   if(handle1 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA1");
      return (INIT_FAILED);
     }
   handle2= iMA (Symbol2, Timeframe, MA_Period, 0, MA_Method, MA_Price);
   if(handle2 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA2");
      return (INIT_FAILED);
     }

   handle3= iMA(Symbol3, Timeframe, MA_Period,0,MA_Method, MA_Price);
   if(handle3 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA3");
      return (INIT_FAILED);
     }
   handle4= iMA(Symbol4, Timeframe, MA_Period, 0, MA_Method, MA_Price);
   if(handle4 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA4");
      return (INIT_FAILED);
     }
     handle5= iMA(Symbol5, Timeframe, MA_Period,0,MA_Method, MA_Price);
   if(handle5 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA5");
      return (INIT_FAILED);
     }
   handle6= iMA (Symbol6, Timeframe, MA_Period, 0, MA_Method, MA_Price);
   if(handle6 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA6");
      return (INIT_FAILED);
     }

   handle7= iMA(Symbol7, Timeframe, MA_Period,0,MA_Method, MA_Price);
   if(handle7 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA7");
      return (INIT_FAILED);
     }
   handle8= iMA(Symbol8, Timeframe, MA_Period, 0, MA_Method, MA_Price);
   if(handle8 == INVALID_HANDLE)
     {
      Print("Errore durante la creazione dell'indicatore MA8");
      return (INIT_FAILED);
     }

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   if(handle1!=INVALID_HANDLE)
      IndicatorRelease(handle1);
   if(handle2!=INVALID_HANDLE)
      IndicatorRelease(handle2);
   if(handle3!=INVALID_HANDLE)
      IndicatorRelease(handle3);
   if(handle4!=INVALID_HANDLE)
      IndicatorRelease(handle4);
   if(handle5!=INVALID_HANDLE)
      IndicatorRelease(handle5);
   if(handle6!=INVALID_HANDLE)
      IndicatorRelease(handle6);
   if(handle7!=INVALID_HANDLE)
      IndicatorRelease(handle7);
   if(handle8!=INVALID_HANDLE)
      IndicatorRelease(handle8);
  }

 

I add that the problem is only created on the tester, while on the MT5 in real time it works well, with no errors.

 

Sorry, I was pointing the second currency NSDUSD instead of NZDUSD. After a whole day of programming I think I'm tired.

Reason: