No single Squeeze Momentum setting wins across every market, and reading LazyBear's 41-line source uncovers something almost no settings guide mentions: BB MultFactor (2.0 on line 8) is never used anywhere in Squeeze Momentum Indicator [LazyBear]. Line 17 writes dev = multKC * stdev(source, length), silently locking the Bollinger multiplier to KC MultFactor (1.5). Toggle between LazyBear's line 17 and the fixed BB MultFactor formula on the simulated candles below to watch what each input actually moves.
LazyBear line 17 · BB(20, 2.00) vs KC(20, 1.50): 26 Squeeze-On bars, 3 squeeze releases (simulated).
Try dragging BB MultFactor right now: nothing on the chart moves, because LazyBear's line 17 multiplies stdev() by KC MultFactor (1.50) instead of BB MultFactor (2.00). Switch to "Fixed BB MultFactor" above to see BB(20, 2.00) against KC(20, 1.50). Squeeze fired at 11:30, 17:45, 19:30 UTC.
Simulated 15-minute candles, not market data: two compression ranges and two releases generated deterministically to illustrate LazyBear's lines 7–40 (nqQ1DT5a, read 11 November 2026). Counts describe these simulated bars only; no trade outcomes are shown.
Drill code: our TypeScript port of Squeeze Momentum Indicator [LazyBear] by LazyBear, used under the Mozilla Public License 2.0. Its source: open-source code on ProEA.
Read preset comparison as table
| Squeeze Preset | Line 17 Mode | Squeeze-On Bars | Squeeze-Off Bars | Releases (66 bars) |
|---|---|---|---|---|
| 20 · 2.0 · 1.5 (LazyBear) | KC Mult on both (1.5×) | 26 | 40 | 3 |
| 20 · 2.0 · 1.5 (Fixed BB) | Fixed BB (2.0× vs 1.50×) | 15 | 51 | 1 |
| 20 · 2.0 · 1.25 (DGT vX) | Fixed BB (2.0× vs 1.25×) | 15 | 51 | 1 |
| 14 · 2.0 · 16 · 1.5 (03.freeman) | Fixed BB (2.0× vs 1.50×) | 27 | 31 | 2 |
What we read
On 11 November 2026 we catalogued TradingView's scripts matching "squeeze momentum" and "ttm squeeze": 90 scripts in total—67 open source, 16 protected, and 7 invite-only. At the top sits LazyBear's August 2014 classic, Squeeze Momentum Indicator [LazyBear] (shorttitle = "SQZMOM_LB"), with 118,132 boosts—one of the most boosted community scripts on all of TradingView.
We pulled LazyBear's complete 41-line source and read every line alongside the eleven next most-boosted open-source Squeeze scripts (down to 2,049 boosts), checking which inputs actually touch the math, who copied LazyBear's line 17 verbatim, and who fixed it. Every line number below refers to TradingView's raw source as served on 11 November 2026.
LazyBear's five inputs—and the line 17 bug
LazyBear declares five inputs on lines 7–12:
| Input in Settings | Default | Line | What LazyBear's code actually does with it |
|---|---|---|---|
BB Length | 20 | 7 | Sets the window for sma(close, length) (line 16) and stdev(close, length) (line 17). Does not touch the momentum histogram. |
BB MultFactor | 2.0 | 8 | Nothing. Stored in mult, which never appears again in the remaining 33 lines. |
KC Length | 20 | 9 | Does two separate jobs: sets the Keltner SMA/range window (lines 22–24) and sets the Donchian + SMA + linreg momentum oscillator period (lines 32–33). |
KC MultFactor | 1.5 | 10 | Multiplies the Keltner range (line 25–26) and, because of line 17, also multiplies stdev for the Bollinger Bands! |
Use TrueRange (KC) | true | 12 | When true, Keltner width uses tr (including prior-close gaps); when false, uses candle high - low only (line 23). |
Here are lines 7–20 of nqQ1DT5a verbatim:
length = input(20, title="BB Length")
mult = input(2.0,title="BB MultFactor")
lengthKC=input(20, title="KC Length")
multKC = input(1.5, title="KC MultFactor")
useTrueRange = input(true, title="Use TrueRange (KC)", type=bool)
// Calculate BB
source = close
basis = sma(source, length)
dev = multKC * stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev
Look closely at what happens when BB Length and KC Length are both 20 under LazyBear's line 17:
basisandmaare the exact same number (sma(close, 20)).upperBB - basisis1.5 * stdev(close, 20).upperKC - mais1.5 * sma(tr, 20).
Because multKC (1.5) sits on both sides of lowerBB > lowerKC and upperBB < upperKC, changing neither BB MultFactor nor KC MultFactor changes which bars are in a squeeze when BB Length == KC Length—multKC cancels out algebraically (1.5 * stdev < 1.5 * sma(tr) is identical to stdev < sma(tr))! Test that claim right now in the drill above: keep LazyBear's mode selected, leave both lengths at 20, and slide KC MultFactor from 0.75 to 2.50. Neither the Squeeze-On count nor the release bar moves by a single candle until you either separate the two lengths or click Fixed BB MultFactor.
In our census of the top twelve open-source scripts:
- Copied LazyBear's
dev = multKC * stdevbug verbatim: KivancOzbilgic's 6,686-boost Squeeze Momentum Indicator Version2 (which adds a 5-bar SMA signal trigger line). - Fixed
devto useBB MultFactor: Greeny's TTM Squeeze (10,230 boosts), Beardy_Fred's TTM Squeeze Pro (6,923 boosts), dgtrd's Pine v6 Squeeze Momentum Indicator vX (3,881 boosts), 03.freeman's Strategy (3,422 boosts, whose header comment explicitly notes// v2 - fixed a typo, where BB multipler was always stuck at 1.5), rolgui's SQZ + ADX + TTM (2,793 boosts), OskarGallard's Plus (2,742 boosts), mtahreemalam's Strategy (2,286 boosts), and SeaSide420's vHMA (2,049 boosts).
Why KC Length changes the histogram and BB Length does not
Traders routinely change BB Length expecting faster histogram turns and wonder why the bars stay identical. Lines 32–33 show why:
val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)), sma(close, lengthKC)), lengthKC, 0)
LazyBear's momentum histogram does not use Bollinger Bands or Keltner multipliers at all. For every candle, it:
- Finds the midpoint of the
lengthKC-bar Donchian channel:(highest(high, lengthKC) + lowest(low, lengthKC)) / 2. - Averages that Donchian midpoint with
sma(close, lengthKC)to form an equilibrium price baseline. - Takes
close - baselineand fits a least-squares linear regression line (linreg(..., lengthKC, 0)) over the lastlengthKCcandles.
Lowering KC Length from 20 to 14 makes both the Keltner Channel and the histogram turn faster; lowering BB Length only changes the Bollinger squeeze dots.
How the top open-source Squeeze scripts set their defaults
Across the twelve most-boosted open-source scripts we read on 11 November 2026, defaults cluster around four distinct designs:
| Script & author | Boosts (2026-11-11) | BB defaults | KC defaults | Extra logic or traps in the code |
|---|---|---|---|---|
Squeeze Momentum [LazyBear] (nqQ1DT5a) | 118,132 | 20, 2.0 (unused) | 20, 1.5 (SMA of TR) | Zero alertcondition() calls; dev uses 1.5 instead of 2.0. |
TTM Squeeze (Greeny, eFs5kf8F) | 10,230 | 20, 2.0 | 20, 1.0 (EMA of TR) | Tight 1.0 Keltner multiplier means far fewer Squeeze-On bars. |
TTM Squeeze Pro (Beardy_Fred, 0drMdHsO) | 6,923 | 20, 2.0 | 20 at 1.0, 1.5, 2.0 | Three compression tiers (Low 2.0 black, Mid 1.5 red, High 1.0 orange) + Squeeze Started/Fired alerts. |
Version2 (KivancOzbilgic, NVzKGYFJ) | 6,686 | 20, 2.0 (unused) | 20, 1.5 | Adds SignalPeriod = 5 (sma(val, 5)) plotted as a red cross line; keeps LazyBear's line 17 bug. |
vX by DGT (dgtrd, Dsr7B2xE) | 3,881 | 20, 2.0 (ta.bb) | 20, 1.25 (ta.kc) | Native Pine v6, overlay = true on price chart, built-in Squeeze Release alert. |
Strategy [LazyBear] (03.freeman, qp9BoNyS) | 3,422 | 14, 2.0 | 16, 1.5 | Fixes line 17—trap: Custom Backtesting Dates defaults to true and stops taking trades after 14 Dec 2018 until unchecked! |
Watch out for that date-window trap whenever you open community Strategy ports in TradingView's Strategy Tester: 03.freeman's script freezes backtests in December 2018 by default, while mtahreemalam's 2,286-boost strategy (lEQZl0vE) disables short trades (Enable Short Strategy = false) and applies a tight 0.5% stop-loss / 1.0% take-profit out of the box. Always inspect the Inputs tab and commission assumptions before reading any Strategy Tester win rate (see our TradingView backtesting guide, repainting audit guide, and our code read of LuxAlgo's Nadaraya-Watson Envelope repaint switch).
Fixing LazyBear's script in Pine Script v6 (with alerts)
If you want LazyBear's exact indicator upgraded to Pine Script v6, with BB MultFactor actually wired to ta.stdev() and two bar-close alertcondition() calls ready for TradingView's alert dialog, paste this clean v6 version into your Pine Editor (or combine it with an EMA or session VWAP filter in our Pine Script indicator merger):
//@version=6
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © LazyBear: the original "Squeeze Momentum Indicator [LazyBear]", https://www.tradingview.com/script/nqQ1DT5a/
// Modified by ProEA, 2026: ported to Pine Script v6, BB MultFactor wired into the Bollinger stdev, two closed-bar alerts.
indicator("Squeeze Momentum v6 (Fixed BB Mult)", shorttitle = "SQZMOM_v6", overlay = false)
bbLen = input.int(20, "BB Length", minval = 1)
bbMult = input.float(2.0, "BB MultFactor", step = 0.1)
kcLen = input.int(20, "KC Length", minval = 1)
kcMult = input.float(1.5, "KC MultFactor", step = 0.1)
useTr = input.bool(true, "Use TrueRange (KC)")
basis = ta.sma(close, bbLen)
dev = bbMult * ta.stdev(close, bbLen)
upperBB = basis + dev
lowerBB = basis - dev
ma = ta.sma(close, kcLen)
rng = useTr ? ta.tr : (high - low)
rangema = ta.sma(rng, kcLen)
upperKC = ma + rangema * kcMult
lowerKC = ma - rangema * kcMult
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC and upperBB > upperKC
noSqz = not sqzOn and not sqzOff
midDonchian = math.avg(ta.highest(high, kcLen), ta.lowest(low, kcLen))
baseline = math.avg(midDonchian, ta.sma(close, kcLen))
val = ta.linreg(close - baseline, kcLen, 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, "Momentum", color = bcolor, style = plot.style_columns)
plot(0, "Squeeze State", color = scolor, style = plot.style_cross, linewidth = 2)
alertcondition(sqzOn[1] and sqzOff and val > 0 and barstate.isconfirmed, "Bullish Squeeze Release", "Squeeze fired long on closed bar")
alertcondition(sqzOn[1] and sqzOff and val < 0 and barstate.isconfirmed, "Bearish Squeeze Release", "Squeeze fired short on closed bar")
Based on Squeeze Momentum Indicator [LazyBear] by LazyBear (MPL-2.0). Our changes: Pine Script v6, BB MultFactor wired into the Bollinger ta.stdev(), and two closed-bar alerts. The drill above runs our TypeScript port of the same calculation, also MPL-2.0: its source.
Where we stand
Every line number, boost count, and default in this guide was read directly from TradingView's script pages on 11 November 2026 (docs/seo/research/2026-11-11-squeeze-momentum-scripts.md). The drill's 96 candles are deterministic simulated bars built to show two compressions and two releases—never a claim of historical performance. Compare how other top TradingView scripts handle momentum, chop, and volatility spikes in our best MACD indicators code read, Lorentzian Classification settings code read, and Nadaraya-Watson Envelope settings code read, fix any parameter set in advance, and verify it after spread and commission on your own market.
Use this animation on your site.
Frequently asked questions
What are the default settings for Squeeze Momentum Indicator [LazyBear]?
LazyBear's script ships five inputs: BB Length 20, BB MultFactor 2.0, KC Length 20, KC MultFactor 1.5 and Use TrueRange (KC) switched on. However, line 17 of LazyBear's code writes dev = multKC * stdev(source, length), so BB MultFactor (2.0) is never referenced anywhere in the calculation—both the Bollinger Bands and Keltner Channels use KC MultFactor (1.5) unless you edit line 17.
Why does changing BB MultFactor in LazyBear's Squeeze Momentum do nothing?
Because of a one-variable typo on line 17 of LazyBear's published Pine script: mult = input(2.0, title='BB MultFactor') is declared on line 8, then line 17 computes dev = multKC * stdev(source, length) using multKC instead of mult. Later open-source ports such as Beardy_Fred's TTM Squeeze Pro, dgtrd's vX and 03.freeman's Strategy explicitly fix line 17 to multiply stdev by the Bollinger multiplier.
What do the four histogram colors and zero-line crosses mean?
The histogram plots a linear regression (linreg) of price minus the midpoint of the Donchian high-low average and the SMA of close over KC Length bars. Above zero, bright lime means momentum is rising (val > val[1]) and dark green means positive momentum is slowing; below zero, bright red means negative momentum is accelerating downward and maroon means downward momentum is slowing. On the zero line, black crosses mark Squeeze On (Bollinger inside Keltner), gray crosses mark Squeeze Off (Bollinger outside Keltner), and blue crosses mark one side inside and one outside.
What is the difference between LazyBear's Squeeze Momentum and TTM Squeeze Pro?
John Carter's classic TTM Squeeze compares a 20-period, 2.0-stdev Bollinger Band against a single 20-period, 1.5-ATR Keltner Channel. Open-source TTM Squeeze Pro scripts (such as Beardy_Fred's 6,923-boost script and OskarGallard's Plus edition) fix the 2.0 Bollinger multiplier and compare it against three Keltner multipliers at once: 2.0 for a Low compression squeeze, 1.5 for a Mid squeeze and 1.0 for a High compression squeeze.
Does LazyBear's Squeeze Momentum Indicator have built-in alerts or repaint?
LazyBear's original 41-line script contains zero alertcondition() calls. Its math uses close, high, low and SMA/linreg on the current timeframe without request.security(), so closed bars never change; while a candle is still forming, both the histogram bar and the zero-line cross update tick by tick until the bar closes.



