indicator · own pane · open source
TTM Squeeze indicator
TTM Squeeze is a free open-source indicator by @deepwick. TTM Squeeze highlights when Bollinger Bands squeeze inside Keltner Channels (vol… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What TTM Squeeze does
TTM Squeeze highlights when Bollinger Bands squeeze inside Keltner Channels (vol compression — grey background). The histogram then shows which way momentum is releasing.
- Squeeze fires while bands are inside channels; trade the histogram direction once it releases.
- Positive green bars = bullish momentum building, red = bearish.
- Combine with a higher-timeframe trend filter for cleanest signals.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("TTM Squeeze", overlay=false)
len = input.int(20, "Length", minval=2, maxval=200)
colorNeutral = input.color("color.gray", "Color Neutral")
colorUp = input.color("color.green", "Color Up")
colorDown = input.color("color.red", "Color Down")
[bm, bu, bl] = ta.bb(close, len, 2)
[km, ku, kl] = ta.kc(close, len, 1.5)
sqz = bl > kl and bu < ku
mid = math.avg(math.avg(ta.highest(high, len), ta.lowest(low, len)), ta.sma(close, len))
mom = ta.linreg(close - mid, len, 0)
bgcolor(sqz ? color.new(colorNeutral, 85) : na)
hline(0, "Zero", color=colorNeutral, linestyle=hline.style_dashed)
p_Momentum = plot(mom, "Momentum", color=mom >= 0 ? colorUp : colorDown, style=plot.style_columns)
alertcondition(sqz[1] and not sqz, "Squeeze released", "Bollinger Bands exited Keltner Channel")
alertcondition(ta.crossover(mom, 0), "Momentum turns up", "TTM squeeze momentum crossed above zero")
No comments yet.
Sign in to comment.