How Bollinger Bands Indicator Works
Bollinger Bands calculations uses standard deviation to plot the bands, the default value used is 2.
The middle line is a simple moving average
The upper line is: Middle line + Standard Deviation
The lower line is: Middle line - Standard Deviation
Bollinger considered the best default for his indicator to be 20 periods moving average and the the bands are then overlaid on the price action.
Standard Deviation is a statistics concept. It originates from the notion of normal distribution. One standard deviation away from the mean either plus or minus, will enclose 67.5 % of all price action movement. Two standard deviations away from the mean either plus or minus, will enclose 95 % of all price action movement.
This is why the Bollinger Bands indicator uses the standard deviation of 2 which will enclose 95 % of all price action. Only 5 % of price action will be outside the bands, this is why traders open or close trades when price hits one of the outer Bands.
The Bollinger Bands indicator main function is to measure volatility. What the bands upper and lower limits try to do is to confine price action of up to 95 percent of the possible closing prices.
This indicator compares the current closing price with the moving average of the closing price. The difference between them is the volatility of the current price compared to the moving average. The volatility will increase or decrease the standard deviation.