iMAOnArray with MODE_SMMA

 

Hi there,

is iMAOnArray working with MODE_SMMA? Regardless my settings it always returns the values with MODE_SMA.

void OnStart()
  {
//---
   double buffer[3];
   int shift = 1;
   for(int i = 0; i < 3; i++){    
    buffer[i] = iStdDev(Symbol(),Period(),10,0,MODE_SMA,PRICE_CLOSE,i+shift);    
    Print(i+shift+": "+buffer[i]);
   }
   
   Print(iMAOnArray(buffer,0,3,0,MODE_SMMA,0));
  }
 

Maybe I did not describe enough the bug in detail. I hope someone from MQL is going to answer.

When calculating iMAOnArray there is always MODE_SMA being used. Also if you chose MODE_SMMA  iMAOnArray is calculating using MODE_SMA.

To put the question in other words: Is it possible to make iMAOnArray use MODE_SMMA?

 
Jan Tarnogrocki:

Hi there,

is iMAOnArray working with MODE_SMMA? Regardless my settings it always returns the values with MODE_SMA.

Which is perfectly normal. Do you know how SMMA is calculated ? You should check.

If you have X values and you are calculating SMMA on a X period, SMA=SMMA.

You need at least 5 values in your buffer to calculate SMMA with a period=3.