iMAONARRAY problem

 

I'm trying to put ma on rsi in expert advisor but it says Array out of range

  double limit=Bars-1;
   double ma[];
   double ima[];
  
   ArrayResize(ima,Bars);
   ArrayResize(ma,Bars);
   for(int i=0;i<limit;i++){
   ma[i]=iRSI(Symbol(),0,14,0,i);
   ima[i]=iMAOnArray(ma,0,10,0,0,i);
   }
 
Any one?
 
Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

The code you posted isn't the problem, except you are trying to compute MA before you have populated your data array.

 
William Roeder:
Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

The code you posted isn't the problem, except you are trying to compute MA before you have populated your data array.

this is all the code inside the OnTick function and this is the only code i wrote!
I'm just trying to use it before applying it to my main EA

 
Then i Think i should populate the array first
can you please explain how?
 
   for(int i=0;i<limit;i++){
   ma[i]=iRSI(Symbol(),0,14,0,i);
   }

   for(int i=0;i<limit;i++){
   ima[i]=iMAOnArray(ma,0,10,0,0,i);
   }