by TamaraKGreen· code credited to notprofessorgreen
The TTM Squeeze Divergence indicator plots a classic TTM Squeeze momentum oscillator in a separate pane alongside Bollinger Bands and Keltner Channels squeeze status dots on the zero line.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
127 lines of Pine Script v6 from TTM Squeeze Divergence.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
TTM Squeeze Divergence detects regular and hidden bullish and bearish divergences between price swings and oscillator pivot highs or lows. Users can adjust Bollinger Band and Keltner Channel parameters, pivot lookback lengths, and divergence evaluation ranges. Plots can be offset historically or delayed until candle close to mitigate live-bar repainting, though unconfirmed pivots naturally repaint until right bars confirm.
TTM Squeeze momentum histogram
Bollinger Bands and Keltner Channels squeeze detection
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
BB Length
int
20
length
BB MultFactor
float
2.0
mult
KC Length
int
20
lengthKC
KC MultFactor
float
1.5
multKC
Use TrueRange (KC)
bool
true
useTrueRange
Plot on price (rather than on indicator)
bool
false
overlay_main
Pivot Lookback Right
int
5
lbR
Pivot Lookback Left
int
5
lbL
Max of Lookback Range
int
60
rangeUpper
Min of Lookback Range
int
5
rangeLower
Plot Bullish
bool
true
plotBull
Plot Hidden Bullish
bool
false
plotHiddenBull
Show all 15 settings
Setting
Type
Default
Variable
Plot Bearish
bool
true
plotBear
Plot Hidden Bearish
bool
false
plotHiddenBear
Delay plot until candle is closed (don't repaint)
bool
false
delay_plot_til_closed
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator plots a TTM Squeeze momentum oscillator and a MACD line in a separate pane. It builds the squeeze oscillator from a linear regression of price against a high-low and simple moving average midpoint, and colors the area by slope and sign. Circles
The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend
This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers
This indicator marks RSI divergences only when price trades beyond daily VWAP standard-deviation bands. It compares recent RSI extremes with price highs and lows over a lookback window, and it treats a divergence as valid only while RSI stays beyond overbought
This indicator detects contrarian inflection points and potential market reversals by combining sentiment, volume, and price action metrics directly on the price chart. It evaluates overbought and oversold conditions with the RSI and Stochastic oscillators, hi
This indicator projects a dual-asset momentum matrix visualizer directly onto the price chart overlay. It calculates normalized momentum for the chart symbol using either RSI or Stochastic inputs adjusted by ATR volatility, and compares it against a benchmark