indicator · own pane · open source
Bollinger Squeeze Histogram
Running…
Loading chart…
About
Bollinger Squeeze Histogram is a momentum proxy = close − SMA(close,20) with the BB-inside-KC squeeze flagged as a grey background.
- Positive histogram bars = bullish momentum building.
- Negative histogram bars = bearish momentum building.
- Grey background = squeeze is on, prepare for release.
Source code
//@version=5
indicator("Bollinger Squeeze Histogram", overlay=false)
len = input.int(20, "Length", minval=2, maxval=200)
bbMult = input.float(2, "BB multiplier", minval=0.5, maxval=5, step=0.1)
kcMult = input.float(1.5, "KC multiplier", minval=0.5, maxval=5, step=0.1)
bbw = ta.bbw(close, len, bbMult)
[km, ku, kl] = ta.kc(close, len, kcMult)
sqz = bbw < (ku - kl) / (ta.sma(close, len) * 0.1)
bgcolor(sqz ? color.new(color.gray, 85) : na)
hline(0, "Zero", color=color.gray)
p_Mom = plot(close - ta.sma(close, len), "Mom", color=color.blue, style=plot.style_histogram, linewidth=2)
No comments yet.
Sign in to comment.