Robert Cezar / Publications
Forum
MA20 of ATR10 wrong values returned?
I'm new to MQL. I'm trying to get the SMA of the ATR value. Is this supposed to work? int lookback = 1000; for(int i=lookback-1;i>=0;i--) atr[i] = iATR(NULL, 0, 10, i); for(int a=lookback-1;a>=0;a--) ma[a]=iMAOnArray(atr,lookback,20,0,MODE_SMA,a); Print("atr= "+DoubleToStr(atr[1], _Digits)+"