# SMA of ATR in mql4

70
chrisdk2015

Hi,

I have tried to find a solution to the way of calculating SMA of ATR in mql4.

Obviously you can do this in the chart: apply a moving average to ATR but how to do this in mql?

Thanks.

7224

chrisdk2015:

Hi,

I have tried to find a solution to the way of calculating SMA of ATR in mql4.

Obviously you can do this in the chart: apply a moving average to ATR but how to do this in mql?

Thanks.

1) The Atr (incl. the built in iAtr()) is already an exponential moving average - do you need an sma of an ema - what about increasing the given Periods?

2) Calculate the Atr yourself and create an sma of that yourself.

3) Maybe before starting to code just read the what the editor's reference tells about about iAtr()?

70
chrisdk2015
Carl Schreiber:

1) The Atr (incl. the built in iAtr()) is already an exponential moving average - do you need an sma of an ema - what about increasing the given Periods?

2) Calculate the Atr yourself and create an sma of that yourself.

3) Maybe before starting to code just read the what the editor's reference tells about about iAtr()?

Thanks,

Increasing period length of ATR I can use that instead of an SMA.