Trendoscope

Bollinger Bands - Custom moving average

Trendoscope Wizard Updated   
Formula for bollinger bands is as below:

Mid = sma(20)
Top = sma(20) + 2*StdDev(20)
Bottom = sma(20) - 2*StdDev(20)

While standard bollinger bands allow changing standard deviation and length, there is no option to use different moving average.

This indicator allows you to define bollinger bands based on different moving average types which can be selected from input.
Release Notes:
Convert to function
Release Notes:
Added another type of base : dc - which stands for Donchian Channel. Instead of using moving average as base, here we are using donchian channel mid as base and applying 2 standard deviation on this to derive top and bottom.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?