CopyBuffer Error

 

I'm trying to convert my EA from trading a singular currency pair to multiple. Before trying to change the number of pairs in use, i didn't have any errors. Since replacing Symbol() with symbol_loop[i], converting the handle into an array, looping the RSI handle in the OnInit and looping the symbols in the OnTick, i now get errors from the CopyBuffer function. The error reads that the CopyBuffer could be one of 3 different versions. In my array there isn't a datetime like the other potential functions so I don't quite understand the issue. Would appreciate if someone offered some suggestions. Cheers

   #include <Trade/Trade.mqh>
   CTrade trade;              
 
   int RSI_Handle[];
   datetime old_time;

   string symbol_loop[] = {"USDJPY", "EURUSD", "USDCAD", "GBPUSD"};

      
int OnInit()
  {

   //Resizing the array to number of symbols ready to trade
   ArrayResize(RSI_Handle, ArraySize(symbol_loop));
   //Looping for every symbol
   for(int i = 0; i < ArraySize(symbol_loop); i++)
   {
      RSI_Handle[i] = iRSI(symbol_loop[i], PERIOD_CURRENT, 14, PRICE_CLOSE);
   } 
   
      return(INIT_SUCCEEDED);
   }
   
void OnDeinit(const int reason){


}
   
   
void OnTick(){  
  // Calculating current time
  datetime GMT = iTime(_Symbol, PERIOD_M15, 1);  
  // Check for new 15m candlestick
  if(GMT > old_time){    
      //If so, resets GMT to current value                                         
      old_time = GMT;         
      // Following code executed ONLY when new bar is complete
   
      //Looping for every symbol
      for(int i = 0; i < ArraySize(symbol_loop); i++)
      { 
         double rsi[];
         CopyBuffer(RSI_Handle, MAIN_LINE, 1, 5, rsi);
      }
       
   }

}
 
Is your EA designed to monitor 4 currency pairs simultaneously? If not, it is pointless to do this.


double rsi[];
CopyBuffer(RSI_Handle, MAIN_LINE, 1, 5, rsi);

In case I may answer,

(1) You need to switch RSI_Handle and rsi for each currency pair.

(2) You need to specify the array size of rsi.

(3) Do you think MAIN_LINE can be used to copy rsi? (I have not checked).