What is Bollinger Bands?
Bollinger Bands draw three lines on the price chart. The middle one, the basis, is a moving average of the last 20 bars. The upper and lower bands sit a set number of standard deviations above and below it, with the area between them shaded. When price has been volatile the bands spread apart; when it has been quiet they pull in close.
Bollinger Bands show where price sits relative to its own recent range. A touch of a band is not by itself a signal to buy or sell, and the bands do not predict which way price will break.
How to use Bollinger Bands
- Width. Wide bands mean recent volatility is high; narrow bands mean it is low. A tight squeeze after a quiet stretch is often followed by a larger move, in either direction.
- Price at a band. In a range, price near the upper band is stretched towards the top of its recent distribution and near the lower band towards the bottom. In a strong trend, price can ride one band for many bars.
- The basis. The middle line is a moving average. Price holding above it is read as context for an uptrend, below it for a downtrend.
- Measuring width directly. To see the squeeze as a number, Bollinger BandWidth plots the distance between the bands as a percentage of the basis.
These are ways to read the bands, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| Length | 20 | Bars used for both the moving average and the standard deviation. Shorter bands hug price and react sooner; longer ones are smoother and wider-framed. Minimum 1. |
| Basis MA Type | SMA | Which moving average forms the middle line. EMA, SMMA (RMA), WMA and VWMA are the alternatives. Only the middle line changes; the band width still comes from the standard deviation. |
| Source | Close | Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available. |
| StdDev | 2 | How many standard deviations away from the basis each band sits. Higher puts the bands further out so price touches them less often; lower brings them in. From 0.001 to 50. |
| Offset | 0 | Shifts all three lines forwards or backwards by this many bars, from -500 to 500. At 0 each value is drawn on the bar it was calculated for. |
Adjust the length, basis type, source, width and offset in the indicator settings.
Calculation
Each bar, the indicator takes a moving average of the last Length values and adds and subtracts a multiple of their standard deviation:
basis = SMA(close, 20)
sd = sqrt( sum of (close - mean)^2 / 20 ) (mean = simple average of the same 20 closes)
upper = basis + 2 * sd
lower = basis - 2 * sd
The standard deviation is the population form: the sum of squares is divided by Length, not by one fewer. It is always measured about the simple average of the window, so if Basis MA Type is set to something other than SMA, the bands are centred on that average but sized by the scatter around the simple one.
The bands appear once Length bars are available. Offset moves where the lines are drawn without changing the values themselves.
Limitations
- Band touches are not reversals. In a strong trend price can hug or walk along a band for a long time. Selling every upper-band touch in a rally fights the trend.
- A squeeze has no direction. Narrow bands say a larger move may be coming, not which way it will go.
- Two deviations is not a probability. Price returns are not normally distributed, so the share of bars inside the bands varies by market and timeframe rather than holding at a fixed percentage.
- The live candle moves. The current bar's basis and bands change until that bar closes.
- It is not a strategy. The bands carry no risk management, sizing or exit rule of their own.
Frequently asked questions
Bollinger Bands are a moving average with a band above and below it, each set a number of standard deviations away. The bands widen when price is volatile and narrow when it is quiet, so they show how far price has moved from its own recent average in terms of its own recent behaviour.
Watch the width and where price sits inside it. Narrow bands mark a quiet market that often precedes a larger move. Price at the upper or lower band is stretched relative to its recent range; in a range that can mean a pullback is more likely, while in a strong trend price can keep riding the band.
Yes. The indicator declares five inputs: Length, default 20 with a minimum of 1; Basis MA Type, default SMA, with EMA, SMMA (RMA), WMA and VWMA as alternatives; Source, default close; StdDev, default 2, from 0.001 to 50; and Offset, default 0, from -500 to 500. Open the indicator's settings on the chart to change them.
No. The basis type only changes the middle line. The distance from the basis to each band is always StdDev times the standard deviation around the simple average of the window.
No. Each value uses only that bar and the ones before it, so values on closed bars are not revised. The current candle's bands move while that candle is live and settle when it closes. A non-zero Offset shifts where the lines are drawn, not what they are, so a positive offset draws them ahead of the latest bar.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Bollinger Bands already applied. On any other market, open the indicator picker on the chart and choose Bollinger Bands from the Volatility group.