iBands

Calculates the Bollinger Bands indicator values for any symbol and timeframe.

Syntax

iBands(
symbol: string,
timeframe: number,
index: number,
period: number,
deviation: number,
bands_shift: number,
maType: E_MAType,
applyToPrice: TPriceType,
bufferIdx: 0 | 1 | 2
): number

Parameters

Parameter
Type
Description

symbol

string

Symbol name

timeframe

number

Timeframe in minutes

index

number

Index of the bar to calculate Bands for

period

number

Period for moving average calculation

deviation

number

Number of standard deviations (typically 2)

bands_shift

number

Shift in bars

maType

E_MAType

Moving average type (SMA, EMA, SMMA, LWMA)

applyToPrice

TPriceType

Type of price to use (Open, High, Low, Close, etc.)

bufferIdx

0 | 1 | 2

Buffer index: 0 = Upper, 1 = Middle, 2 = Lower band

Return Value

Returns a number representing the requested Bollinger Band value at the specified bar index.

Description

Calculates Bollinger Bands indicator.

Example

Last updated