Bollinger Bands index formula calculation
1) Calculate MA
MA=Sum of closing prices in N days ÷ N
2) Calculate the standard deviation MD
MD = the sum of the two square roots of N days (C-MA) divided by N
3) Calculate MB, UP, DN lines
MB=(N-1) day MA
UP=MB+2×MD
DN = MB-2 × MD
N refers to the number of candlesticks, which can be a day or an hour