Bollinger Bands
Previous Topic  Next Topic 

Definition

Courtesy of www.stockcharts.com
Courtesy of www.marketscreen.com

Syntax
Bollinger(double numStdDev, int period)
Bollinger(IDataSeries inputData, double numStdDev, int period)

Returns upper band value
Bollinger(double numStdDev, int period).Upper[int barsAgo]
Bollinger(IDataSeries inputData, double numStdDev, int period).Upper[int barsAgo]

Returns lower band value
Bollinger(double numStdDev, int period).Lower[int barsAgo]
Bollinger(IDataSeries inputData, double numStdDev, int period).Lower[int barsAgo]


Return Type
double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.


Parameters

numStdDev

The number of standard deviations

period

The number of bars to include in the calculation

inputData

Indicator source data (?)


Examples

// Prints the current upper band value of a 20 period Bollinger using default price type
double upperValue = Bollinger(2, 20).Upper[0];
Print("The current Bollinger upper value is " + upperValue.ToString());

// Prints the current upper band value of a 20 period Bollinger using low price type
double value = Bollinger(Low, 2, 20).Upper[0];
Print("The current Bollinger upper value is " + upperValue.ToString());


Source Code
You can open up the indicator source code via the NinjaScript Editor.