How to calculate Bollinger bands
Bollinger bands are calculated using three lines drawn onto a price chart. The first line is the SMA of an assets's price, usually within a 20-day period. The upper band is the SMA plus two standard deviations, while the lower band is the SMA minus two standard deviations.
To calculate the SMA, you would take the closing prices for the number of days that you were looking at – normally 20 days – and divide the total sum of all the closing prices by the total number of days.
Once you have the SMA, you can calculate the upper and lower bands:
- The upper band = 20-day simple moving average plus (20-day standard deviation multiplied by 2)
- The lower band = 20-day simple moving average minus (20-day standard deviation multiplied by 2)
Most trading platforms will calculate Bollinger bands for you automatically, but it is still useful for a trader to know what the different bands mean and what can be learnt from them.