﻿ BollingerBands(SeriesCollection,ElementValue,Double,Int32) Method
 dotnetCHARTING Send comments on this topic. BollingerBands(SeriesCollection,ElementValue,Double,Int32) Method See Also
 Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: Visual Basic (Declaration) Language Filter: Visual Basic (Usage) Language Filter: C#
 dotnetCHARTING Namespace > FinancialEngine Class > BollingerBands Method : BollingerBands(SeriesCollection,ElementValue,Double,Int32) Method

sc
A collection of series objects. For example, to evaluate this indicator for two series you will need to pass a series collection containing this two series.
elementValue
Specifies the particular element value (for example High, Low, Close or Open of the financial time series) which will be considered within this indicator evaluation. In particular, if you wish to use the element value high then you should pass the parameter High. In a similarly fashion if you wish to use the low, close or open, then you should pass the parameter Low, Close, Open, respectively.
standardDeviationLevel
The (positive) number of standard deviations which the lower band in shifted from the moving average.
lengthOfMA
The length of the moving average used within the evaluation of the Bollinger Bands. Note that this also corresponds to the length of the period over which the standard deviation is evaluated.
Within this class we offer procedures which evaluate the upper and lower Bollinger Bands.

# Syntax

Visual Basic (Declaration)
```Public Overloads Shared Function BollingerBands( _
ByVal sc As SeriesCollection, _
ByVal elementValue As ElementValue, _
ByVal standardDeviationLevel As Double, _
ByVal lengthOfMA As Integer _
) As SeriesCollection```
Visual Basic (Usage)Copy Code
``````Dim sc As SeriesCollection
Dim elementValue As ElementValue
Dim standardDeviationLevel As Double
Dim lengthOfMA As Integer
Dim value As SeriesCollection

value = FinancialEngine.BollingerBands(sc, elementValue, standardDeviationLevel, lengthOfMA)``````
C#
```public static SeriesCollection BollingerBands(
SeriesCollection sc,
ElementValue elementValue,
double standardDeviationLevel,
int lengthOfMA
)```

#### Parameters

sc
A collection of series objects. For example, to evaluate this indicator for two series you will need to pass a series collection containing this two series.
elementValue
Specifies the particular element value (for example High, Low, Close or Open of the financial time series) which will be considered within this indicator evaluation. In particular, if you wish to use the element value high then you should pass the parameter High. In a similarly fashion if you wish to use the low, close or open, then you should pass the parameter Low, Close, Open, respectively.
standardDeviationLevel
The (positive) number of standard deviations which the lower band in shifted from the moving average.
lengthOfMA
The length of the moving average used within the evaluation of the Bollinger Bands. Note that this also corresponds to the length of the period over which the standard deviation is evaluated.

# Remarks

### Further Details

Bollinger Bands are a type of envelope that are plotted at standard deviation levels above and below the corresponding (simple) moving average. This produces an effect of having the bands widen during periods of higher volatility and contract during less volatile periods. Bollinger Bands indicate the relative supply and demand for a given asset. If the asset to move close to the top of the envelope then it indicates that there is strong demand for the asset, conversely if the asset hugs the bottom of the trading range then it indicates that there is oversupply of the asset.

Since the Bollinger Bands will nearly always be combined with other indicators when forming a trading system the number of periods used in the evaluation of the standard deviation of the stocks and the moving average will vary. For those without design restrictions a popular choice of the number of time periods is around 20-23.