The Bollinger Bands (BB) were created in the early 1980s by financial analyst and trader John Bollinger. Bollinger Bands work as an oscillator. It indicates whether the market has high or low volatility, as well as overbought or oversold conditions.
The core concept behind the BB indicator is to highlight how prices are dispersed around an average value. More specifically, it is composed of an upper band (red), a lower band (yellow), and a middle band (blue), also known as the middle moving average line. The two sidelong bands react to the market price action, expanding when the volatility is high, moving away from the middle line) and contracting when volatility is low, moving towards the middle line.
Middle line = (SMA, n)Upper band = (SMA, n) + (20-day standard deviation * y)Lower band = (SMA, n) - (20-day standard deviation * y)Where:n = Time Periody = standard deviation multiplier
The standard Bollinger Bands formula sets the middle line as a X-day Simple Moving Average (SMA) while the upper and lower bands are calculated based on the market volatility in relation to the SMA, which is referred to as standard deviation.