Indicator · Pine Script v6 · Own pane

Squeeze Momentum [LazyBear]

by nesari

This indicator calculates the classic LazyBear Squeeze Momentum oscillator, combining Bollinger Bands and Keltner Channels to detect market consolidation and momentum expansion.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code31
Settings5inputs
LicenceMIT
Last update9 days ago15 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

31 lines of Pine Script v6 from src/renderer/assets/pine-samples/sqzmom-v6.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

sqzmom-v6.pine
//@version=6
indicator('Squeeze Momentum [LazyBear]', 'SQZMOM_LB', overlay = false)

length = input.int(20, 'BB Length')
mult = input.float(2.0, 'BB MultFactor')
lengthKC = input.int(20, 'KC Length')
multKC = input.float(1.5, 'KC MultFactor')
useTrueRange = input.bool(true, 'Use TrueRange (KC)')

source = close
basis = ta.sma(source, length)
dev = multKC * ta.stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev

ma = ta.sma(source, lengthKC)
rng = useTrueRange ? ta.tr : (high - low)
rangema = ta.sma(rng, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC

sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC)
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC)
noSqz = (sqzOn == false) and (sqzOff == false)

val = ta.linreg(source - math.avg(math.avg(ta.highest(high, lengthKC), ta.lowest(low, lengthKC)), ta.sma(close, lengthKC)), lengthKC, 0)

bcolor = val > 0 ? (val > nz(val[1]) ? color.lime : color.green) : (val < nz(val[1]) ? color.red : color.maroon)
scolor = noSqz ? color.blue : sqzOn ? color.black : color.gray
plot(val, color = bcolor, style = plot.style_histogram, linewidth = 4)
plot(0, color = scolor, style = plot.style_cross, linewidth = 2)

Overview

Squeeze Momentum [LazyBear] plots a linear regression momentum histogram in a separate pane alongside a zero line that changes color according to squeeze states (on, off, or neutral). Four distinct histogram colors signal whether momentum is increasing or decreasing above or below zero. Input settings allow adjustments to band lengths, multiplier factors, and true range calculations.

Details

Published by

nesari on GitHub

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

chartingelectronmetatraderpine-scripttrading

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
BB Lengthint20length
BB MultFactorfloat2.0mult
KC Lengthint20lengthKC
KC MultFactorfloat1.5multKC
Use TrueRange (KC)booltrueuseTrueRange
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.

Similar Pine Scripts

TTM Squeeze

by Alorse
368 stars

This indicator plots a TTM Squeeze momentum oscillator in a separate pane. It compares a Bollinger Band offset to a Keltner Channel offset and marks the zero line white when the difference is non-negative and black when the bands are inside the channel. A line

Indicator v5 Oscillators & momentumVolatility & bands
Updated 3 months ago · None stated GitHub repository of TTM Squeeze

Function - Logistic Equation

by ricardosantos79
261 stars

Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist

Indicator v5 Oscillators & momentumVolatility & bands
Updated 5 years ago · None stated GitHub repository of Function - Logistic Equation
228 stars

This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl

Indicator v6 Volatility & bandsOscillators & momentum
Updated 4 months ago · None stated GitHub repository of Bollinger Band Squeeze Detector

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V
147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

Bubbles Indicator

by capissimo
114 stars

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

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of Bubbles Indicator

More Volatility & bands scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers