BollingerBandwidth (Function)
The BollingerBandwidth function returns the difference between the upper and lower Bollinger bands, expressed as a fraction of a moving average of the Price input's value.
Syntax
BollingerBandwidth(Price, Length, NumDevsUp, NumDevsDown)
Returns (Double)
A numeric value for the current bar.
Parameters
Name | Type | Description |
Price |
NumericSeries
|
An EasyLanguage expression. The standard deviation and moving average values are calculated based on this expression. See the EasyLanguage code for the Bollinger Bandwidth indicator. |
Length | NumericSimple | The number of bars over which to calculate the standard deviations and moving average. |
NumDevsUp | NumericSimple | The number of standard deviations above the moving average to use in the calculation of the upper band's value. |
NumDevsDown | NumericSimple | The number of standard deviations below the moving average to use in the calculation of the lower band's value. |
Remarks
Normally BollingerBandwidth is calculated using prices, but other, non-price, EasyLanguage expressions can be passed into this function as the price input. For example, the value of RSI( 14 ) could be passed as the Price input if one wished to calculate the Bollnger bandwith of the 14-bar RSI.
The BollingerBandwidth function can be interpreted as a measure of dispersion (volatility) of the Price input's value.
The value for the Length input parameter should always be a positive whole number greater than 0.
The NumDevsUp and NumDevsDown values are both expressed as positive values. The function adds NumDevsUp standard deviations to the moving average's value and subtracts NumDevsDown standard deviations from the moving average's value.
Example
See the EasyLanguage code for the built-in indicator "Bollinger Bandwidth."
See Also
Reference
John Bollinger, "Bollinger on Bollinger Bands," (McGraw-Hill, 2002).