Is there a bug in "iMAOnArray" ?

 

Hi,

after I wasn't able to eliminate some differences I had closer look at iMaOnArray and I programmed a simple example.

I created a buffer (sma(n)-sma(2n)) and let iMaOnArray create another sma(2) which I calculated my self too and displayed the result on the chart:

1) See the big difference of the candle[3] with the biggest body.

2) Watch the Bar[0] while 'my' average of [0] and [1] changes at every new tick iMaOnArray does change at all it keeps its value based on Open[0] of the bar.

I attached this indicator so you can check yourself - the service desk hasn't answered yet, and may be I just misunderstand the idea of iMaOnArray(..).

Wait for some big bars and use M1-chart for faster results.

Gooly

Files:
 
   for (i=limit-1;i>=0;i--){
      FastBuff[i] = (iMAOnArray(MaBuff,0,MaMa_PerFast,0,MaMa_Method,i));
      SlowBuff[i] = (iMAOnArray(MaBuff,0,MaMa_PerSlow,0,MaMa_Method,i)); 
   }
 

Ahh - thank you, that's it.

That's the result if you trust unchecked commercially propagated indicators!

Thanks again!!

Gooly