place two lines around an average. The middle is usually the SMA 20 of the closes. The upper band lies two above it, the lower band two below. If prices swing a lot, the bands widen; when it gets calm, they move together. So the bands measure volatility, not direction.
What the standard deviation measures
The standard deviation tells you how far the closes typically deviate from their average. Example with eight prices: 2, 4, 4, 4, 5, 5, 7, 9. Average 5, squared distances together 32, divided by 8 gives 4, its square root 2. With width 2 the bands would be at 1 and 9.
Outside does not mean wrong
Even with width 2, prices close outside the bands again and again – in the model 14 of 111 closes. Prices are not normally distributed and run in trends, so the rule of thumb “95% inside” only fits roughly. A close above the upper band is not a reason to sell, but a large deviation from the average.
The settings
The standard is 20 candles and width 2. A smaller width leaves more closes outside, a larger one fewer. A longer period makes the middle and bands calmer and slower – as with every moving average.