Skip to main content

bbands

Calculate the Bollinger Bands.

Consist of three lines. The middle band is a simple moving average (generally 20 periods) of the typical price (TP). The upper and lower bands are F standard deviations (generally 2) above and below the middle band. The bands widen and narrow when the volatility of the price is higher or lower, respectively.

Bollinger Bands do not, in themselves, generate buy or sell signals; they are an indicator of overbought or oversold conditions. When the price is near the upper or lower band it indicates that a reversal may be imminent. The middle band becomes a support or resistance level. The upper and lower bands can also be interpreted as price targets. When the price bounces off of the lower band and crosses the middle band, then the upper band becomes the price target.

Parameters

data: list[openbb_core.provider.abstract.data.Data]

list of data to be used for the calculation.

Optional: False


target: str

Target column name.

Default: close

Optional: True


index: str

Index column name to use with data, by default 'date'.

Default: date

Optional: True


length: int

Number of periods to be used for the calculation, by default 50.

Default: 50

Optional: True


std: float

Standard deviation to be used for the calculation, by default 2.

Default: 2

Optional: True


mamode: Literal['sma', 'ema', 'wma', 'rma']

Moving average mode to be used for the calculation, by default 'sma'.

Default: sma

Optional: True


offset: int

Offset to be used for the calculation, by default 0.

Optional: True


Returns

results: list[Data]

Serializable results.


provider: None

Provider name.


warnings: Optional[list[Warning_]]

list of warnings.


chart: Optional[Chart]

Chart object.


extra: dict[str, Any]

Extra info.


On this page