double moving average of RSI

 
Hi,
I need some help to code the double moving average of RSI(14).
I would like to know if it's the right way to do?


for (i=0; i<1000; i++)
RSI_Buffer[i] = iRSI (NULL, 0, 14, PRICE_CLOSE, i);

for(i=0; i<1000; i++)
tmp[i] = iMAOnArray (RSI_Buffer, Bars, 14, 0, MODE_EMA, i);

for(i=0; i<1000; i++)
RSI_Double[i] = iMAOnArray (tmp, Bars, 14, 0, MODE_EMA, i);

Thanks.
Mat
 
we recommend use another loop expression like in our samples
int start()
  {
   int i,limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(i=0; i<limit; i++)
      RSI_Buffer[i]=iRSI(NULL,0,14,PRICE_CLOSE,i);
   for(i=0; i<limit; i++)
      tmp[i]=iMAOnArray(RSI_Buffer,Bars,14,0,MODE_EMA,i);
   for(i=0; i<limit; i++)
      RSI_Double[i]=iMAOnArray(tmp,Bars,14,0,MODE_EMA,i);
   return(0);
  }
 
thanks Slawa.
regards,
Mat
Reason: