| Overloads | |
|---|---|
| BollingerBands(int, int, double[], int, double, double, MAType) | Calculates Bollinger Bands for a price series. |
| BollingerBands(int, int, float[], int, double, double, MAType) | Calculates Bollinger Bands for a price series using float arrays. |
Calculates Bollinger Bands for a price series.
public static TechnicalAnalysis.Functions.BollingerBandsResult BollingerBands(int startIdx, int endIdx, double[] real, int timePeriod=5, double nbDevUp=2.0, double nbDevDn=2.0, TechnicalAnalysis.Common.MAType maType=TechnicalAnalysis.Common.MAType.Sma);startIdx System.Int32
The starting index for the calculation range.
endIdx System.Int32
The ending index for the calculation range.
real System.Double[]
Array of price values (typically closing prices).
timePeriod System.Int32
The number of periods for the moving average calculation (default: 5).
nbDevUp System.Double
The number of standard deviations for the upper band (default: 2.0).
nbDevDn System.Double
The number of standard deviations for the lower band (default: 2.0).
maType TechnicalAnalysis.Common.MAType
The type of moving average to use for the middle band (default: SMA).
BollingerBandsResult
A BollingerBandsResult object containing the upper band, middle band,
lower band values, and associated metadata.
Bollinger Bands are a volatility indicator consisting of three lines: a middle band (moving average), an upper band (middle band + n standard deviations), and a lower band (middle band - n standard deviations). The bands expand during periods of high volatility and contract during periods of low volatility. They are commonly used to identify overbought/oversold conditions and potential support/resistance levels.
Calculates Bollinger Bands for a price series using float arrays.
public static TechnicalAnalysis.Functions.BollingerBandsResult BollingerBands(int startIdx, int endIdx, float[] real, int timePeriod=5, double nbDevUp=2.0, double nbDevDn=2.0, TechnicalAnalysis.Common.MAType maType=TechnicalAnalysis.Common.MAType.Sma);startIdx System.Int32
The starting index for the calculation range.
endIdx System.Int32
The ending index for the calculation range.
real System.Single[]
Array of price values (typically closing prices).
timePeriod System.Int32
The number of periods for the moving average calculation (default: 5).
nbDevUp System.Double
The number of standard deviations for the upper band (default: 2.0).
nbDevDn System.Double
The number of standard deviations for the lower band (default: 2.0).
maType TechnicalAnalysis.Common.MAType
The type of moving average to use for the middle band (default: SMA).
BollingerBandsResult
A BollingerBandsResult object containing the upper band, middle band,
lower band values, and associated metadata.
This overload accepts float arrays and converts them to double arrays before performing the calculation. Bollinger Bands are a popular technical indicator for measuring volatility and identifying potential support and resistance levels.