top of page

MQL4 Reference / Technical Indicators / iBands



Calculates the Bollinger Bands® indicator and returns its value.

double  iBands(
  string       symbol,           // symbol
  int          timeframe,        // timeframe
  int          period,           // averaging period
  double       deviation,        // standard deviations
  int          bands_shift,      // bands shift
  int          applied_price,    // applied price
  int          mode,             // line index
  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 to calculate the main line.


          [in]  Number of standard deviations from the main line.


          [in]  The indicator shift relative to the chart.


          [in]  Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.


          [in]  Indicator line index. It can be any of the Indicators line identifiers enumeration value (0 - MODE_MAIN, 1 - MODE_UPPER, 2 - MODE_LOWER).


          [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 Bollinger Bands® indicator.


if(iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)>Low[0]) return(0);

Page 1 of 3

bottom of page