top of page

MQL4 Reference / Technical Indicators / iATR


Calculates the Average True Range indicator and returns its value.

double  iATR(
  string       symbol,     // symbol
  int          timeframe,  // timeframe
  int          period,     // averaging period
  int          shift       // shift



          [in]  Symbol name on the data of which the indicator will be calculated. NULL means the current symbol.


          [in]  Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.


          [in]  Averaging period.


          [in]  Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

Returned value

          Numerical value of the Average True Range indicator.



  if(iATR(NULL,0,12,0)>iATR(NULL,0,20,0)) return(0);

Page 1 of 3

bottom of page