MQL4 iATR Indicator

Overview

Calculates the Average True Range (ATR) indicator and returns its numerical value.

Function Signature

double iATR(string symbol, int timeframe, int period, int shift);

Parameters

  • **symbol**: string - The name of the symbol for calculation. NULL uses the current symbol.
  • **timeframe**: int - The timeframe. Use ENUM_TIMEFRAMES values. 0 uses the current chart timeframe.
  • **period**: int - The averaging period for the ATR calculation.
  • **shift**: int - The index of the value relative to the current bar (e.g., 0 for the current bar, 1 for the previous bar).
  • Return Value

  • double - The numerical value of the Average True Range indicator.
  • Example

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

    Related Indicators

  • [iAO](/indicators/iao)
  • [iBearsPower](/indicators/ibearspower)
  • Platform Links

  • [MQL4 Documentation](https://docs.mql4.com/en)
  • [MetaTrader 5 Download](https://download.mql5.com/cdn/web/metaquotes.ltd/mt5/mt5setup.exe)