// This Strategy was Created by ©NoobSharks // if you use it and like it, send us some donation: BinancePay ID: 223731148 - Metamask: 0x82782b3ebD1d6bf7faa18a3943fA6f16EBBF3134 // (yes, I might be naive but I trully Believe you will support us) // For more information about this indicator check "https://www.youtube.com/c/NoobSharksLutanoMercadoCripto" and give us a hand following us on YouTube // Check also our website includeing strategies, free indicatores and technical analysis videos: https://www.noobsharks.com //@version=6 indicator(shorttitle = '[NB]IND.BB.AdjustableMA', title = '[NBpkgf] Indicator - Bollinger Bands Adjustable Moving Average', overlay = true, timeframe = '', timeframe_gaps = true) // inputs maTp = input.string(defval = 'SMA', options = ['EMA', 'HMA', 'RMA', 'SMA', 'SWMA', 'VWAP', 'VWMA', 'WMA'], title = 'MA Type', group = 'Bollinger Bands') len = input.int(defval = 20, minval = 1, title = 'MA Length', group = 'Bollinger Bands') src = input(close, title = 'MA Source', group = 'Bollinger Bands') mult = input.float(2.0, minval = 0.001, maxval = 50, title = 'StdDev', group = 'Bollinger Bands') length = input.int(defval = 55, title = 'MA Volume Length', minval = 2, group = 'Institutional Candle Color') thresholdExtraHigh = input.float(defval = 4, title = 'Extra High Volume Index', group = 'Institutional Candle Color') // functions selectMa(TypeF, srcF, lenF) => if TypeF == 'SMA' selectMa = ta.sma(srcF, lenF) selectMa else if TypeF == 'EMA' selectMa = ta.ema(srcF, lenF) selectMa else if TypeF == 'RMA' selectMa = ta.rma(srcF, lenF) selectMa else if TypeF == 'WMA' selectMa = ta.wma(srcF, lenF) selectMa else if TypeF == 'VWMA' selectMa = ta.vwma(srcF, lenF) selectMa else if TypeF == 'HMA' selectMa = ta.hma(srcF, lenF) selectMa else if TypeF == 'SWMA' selectMa = ta.swma(srcF) selectMa else na // bb calculation and plot basis = selectMa(maTp, src, len) dev = mult * ta.stdev(src, len) upper = basis + dev lower = basis - dev plot(basis, 'Basis', color = color.navy) p1 = plot(upper, 'Upper Band', color = color.gray) p2 = plot(lower, 'Lower Band', color = color.gray) fill(p1, p2, title = 'Background', color = color.new(color.navy, transp = 90)) // inputs thresholdHigh = thresholdExtraHigh / 1.6 thresholdMedium = thresholdExtraHigh / 4 thresholdNormal = thresholdExtraHigh / 8 - thresholdMedium // calc mean = ta.sma(volume, length) std = ta.stdev(volume, length) stdbar = (volume - mean) / std // bar colors bcolor = stdbar > thresholdExtraHigh ? color.red : stdbar > thresholdHigh ? color.orange : stdbar > thresholdMedium ? color.yellow : stdbar > thresholdNormal ? color.white : color.blue barcolor(bcolor, title = 'Volume Bar Color')