BollingerBands
class backtide.indicators.BollingerBands(period=20, std_dev=2.0)
Bollinger Bands (BB).
Volatility bands placed above and below an n-period SMA. The bands widen during high volatility and contract during low volatility. Useful for volatility assessment, mean-reversion strategies, and breakout detection when price moves outside the bands.
Formula:
\[
\begin{aligned}
Upper_t &= SMA_t + k \cdot \sigma_t \\\\
Lower_t &= SMA_t - k \cdot \sigma_t
\end{aligned}
\]
where \(\sigma_t\) is the rolling standard deviation over \(n\) periods. Read more on Wikipedia.
| Parameters |
Number of bars for the moving average.
std_dev : float, default=2.0
Number of standard deviations.
|
| Attributes |
Short ticker-style acronym.
name : str
Human-readable indicator name.
|
See Also
Average True Range (ATR).
Commodity Channel Index (CCI).
Simple Moving Average (SMA).
Methods
| compute | Compute the indicator on a dataset. |
| description | Short explanation of what the indicator measures. |
method backtide.indicatorscompute(data)
Compute the indicator on a dataset.
method backtide.indicatorsdescription()
Short explanation of what the indicator measures.
| Returns |
str
The description.
|