TTM Squeeze

Whether the Bollinger Bands sit inside the Keltner Channel (a squeeze), plus momentum.

TTM squeeze, all windows period candles with the current included. Bollinger = SMA(x) ± bb_mult × σ (population); Keltner = SMA(x) ± kc_mult × SMA(true range). squeeze_on is true while the Bollinger bands lie inside the Keltner channel (lower BB > lower KC and upper BB < upper KC), else false. momentum = the linear-regression value at the current candle of x − ((highest high + lowest low) ÷ 2 + SMA(x)) ÷ 2. Ready at 2 × period − 1 candles.

Settings

SettingDefaultRangeWhat it does
period202 to 500Candles in every window.
bb_mult20.1 to 10Bollinger distance in standard deviations.
kc_mult1.50.1 to 10Keltner distance in average true ranges.

What it gives

OutputWhat it is
Squeeze onTrue while the squeeze is on.
MomentumSqueeze momentum, in price (+ up, − down).

What it reads

It reads open, high, low, close, hl2, hlc3, ohlc4, hlcc4, close by default.

Warm-up

With its default settings, TTM Squeeze needs 41 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.

Related indicators

Built from: Bollinger Bands, Keltner Channels

Test it

Copy this sentence into the Algonney chat to backtest it:

Backtest a strategy on BTC that uses TTM Squeeze with its default settings