Clarifications on Indicatiorcounted() and EMA

 

Hi can anyone give me clarification of Indicatorcounted funtion. In the below function Does Indicatorcounted plays any major role in EMA function.

If yes how the below function differs from normal EMA plotting

int li_4 = IndicatorCounted();

if (li_4 < 0) return (-1);

if (li_4 > 0) li_4--; int li_0 = Bars - li_4;
for (int i = 0; i < li_0; i++) {
buffer1[i] = iMA(NULL, 0, FastEMA, 0, MODE_EMA, PRICE_CLOSE, i);
buffer2[i] = iMA(NULL, 0, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, i);

}

Thanks you

Rajandran R

 
rajandran:

Hi can anyone give me clarification of Indicatorcounted funtion. In the below function Does Indicatorcounted plays any major role in EMA function.

If yes how the below function differs from normal EMA plotting

Thanks you

Rajandran R

Not major role Rajandran R. If you change the value of li_4 to zero ...

int li_4 = 0;  // IndicatorCounted();

the EMA will still be drawn exactly the same.

Why don't you make copy of that and attach both of them on chart and see if there's any differences.

 
int li_4 = IndicatorCounted();
if (li_4 < 0) return (-1);
if (li_4 > 0) li_4--; int li_0 = Bars - li_4;
  1. That looks like decompiled code to me. We're not going to help you with your stolen code.
  2. Contradictory information on IndicatorCounted() - MQL4 forum