BollingerBand (Function) The BollingerBand function calculates an n standard deviation (StdDev) line (usually 2 StdDevs) above or below a center-line simple moving average.
Syntax
BollingerBand(Price, Length, NumDevs)
Returns (Double)
A numeric value for the current bar.
BollingerBand (Function) Example
Assigns to Value1 the upper BollingerBand, and assigns to Value2 and plots the lower BollingerBand, for each bar based on 2 standard deviations a simple 20 bar average of the Close, then plots Value1 and Value2:
Value1 = BollingerBand(Close,20,2);
Value2 = BollingerBand(Close,20,-2);
Parameters
Name
Type
Description
Price
Numeric
Specifies which bar value (price, function, or formula) to be considered for the center-line average.
Length
Numeric
Sets the number of bars to consider for the center-line average.
NumDevs
Numeric
Sets the number of standard deviations above (positive) or below (negative) the center-line average.
Comment