Complete Suite: all 12 tools. 6 Premium desks inside.All 12 tools $606.98 one by one

$606.98 one by one $97 once Save $509.98Get the SuiteGet it
ProEA Lab · MT5, TradingView and trading research · Evidence standards
Systems

Squeeze Momentum Indicator Settings: LazyBear's Code, Read Line by Line

LazyBear's Squeeze Momentum Indicator (118,132 boosts on TradingView) ships BB Length 20, BB MultFactor 2.0, KC Length 20 and KC MultFactor 1.5—and on line 17 never uses BB MultFactor at all. Here is what every input actually changes across the top open-source Squeeze scripts, with a live drill.

PL · 11 min read
Explainer cover titled Squeeze Momentum settings, code-read: the same simulated 15-minute candles drawn above two Squeeze Momentum panes comparing LazyBear's line 17 formula with the fixed BB MultFactor 2.0 formula.
Links to TradingView in this article are partner links: if you open a new TradingView account through one and buy a plan, TradingView may pay ProEA a commission, at no cost to you.

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.

Move the settings, watch the squeeze dots and histogramLazyBear's 41-line Squeeze Momentum on 66 simulated 15-minute candles. Switch between LazyBear's line 17 formula and the fixed BB MultFactor formula, or test community defaults.
SIMULATED 15M CANDLES · UPPER/LOWER BB (BLUE) VS KELTNER (AMBER)SQUEEZE MOMENTUM (LINREG 20) · AMBER RING = SQUEEZE ON · GRAY = OFF · BLUE = HALF
Try a preset
Line 17 math

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 PresetLine 17 ModeSqueeze-On BarsSqueeze-Off BarsReleases (66 bars)
20 · 2.0 · 1.5 (LazyBear)KC Mult on both (1.5×)26403
20 · 2.0 · 1.5 (Fixed BB)Fixed BB (2.0× vs 1.50×)15511
20 · 2.0 · 1.25 (DGT vX)Fixed BB (2.0× vs 1.25×)15511
14 · 2.0 · 16 · 1.5 (03.freeman)Fixed BB (2.0× vs 1.50×)27312

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 SettingsDefaultLineWhat LazyBear's code actually does with it
BB Length207Sets the window for sma(close, length) (line 16) and stdev(close, length) (line 17). Does not touch the momentum histogram.
BB MultFactor2.08Nothing. Stored in mult, which never appears again in the remaining 33 lines.
KC Length209Does 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 MultFactor1.510Multiplies the Keltner range (line 25–26) and, because of line 17, also multiplies stdev for the Bollinger Bands!
Use TrueRange (KC)true12When 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:

  • basis and ma are the exact same number (sma(close, 20)).
  • upperBB - basis is 1.5 * stdev(close, 20).
  • upperKC - ma is 1.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:

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:

  1. Finds the midpoint of the lengthKC-bar Donchian channel: (highest(high, lengthKC) + lowest(low, lengthKC)) / 2.
  2. Averages that Donchian midpoint with sma(close, lengthKC) to form an equilibrium price baseline.
  3. Takes close - baseline and fits a least-squares linear regression line (linreg(..., lengthKC, 0)) over the last lengthKC candles.

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 & authorBoosts (2026-11-11)BB defaultsKC defaultsExtra logic or traps in the code
Squeeze Momentum [LazyBear] (nqQ1DT5a)118,13220, 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,23020, 2.020, 1.0 (EMA of TR)Tight 1.0 Keltner multiplier means far fewer Squeeze-On bars.
TTM Squeeze Pro (Beardy_Fred, 0drMdHsO)6,92320, 2.020 at 1.0, 1.5, 2.0Three compression tiers (Low 2.0 black, Mid 1.5 red, High 1.0 orange) + Squeeze Started/Fired alerts.
Version2 (KivancOzbilgic, NVzKGYFJ)6,68620, 2.0 (unused)20, 1.5Adds SignalPeriod = 5 (sma(val, 5)) plotted as a red cross line; keeps LazyBear's line 17 bug.
vX by DGT (dgtrd, Dsr7B2xE)3,88120, 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,42214, 2.016, 1.5Fixes 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.

Continue reading

Does Turtle Trading Still Work? The 20/10 Breakout, Tested Once on 2026 Crypto

Breakaway Desk Premium's Trend Radar uses the Turtles' 20 and 10 lengths, counted in 4-hour candles, with a 2N-style stop, long only, on six crypto perpetuals. We picked it on 2021–23, confirmed it on 2025 and ran it once on 2026. Here are the rules beside the originals, every period, and the fall.

Oct 29 · ProEA Lab

Cover titled Does turtle trading still work? It charts the cumulative R of the 137 final-test trades from January to August 2026, rising to +11.7R on 8 January, sliding to −49.0R on 12 August, a fall of 60.7R, then climbing in late August.

TradersPost vs PickMyTrade vs CrossTrade: Which TradingView Bridge for Your Broker

All three turn a TradingView alert into a broker order. They differ in what you pay per account, which brokers they reach and where they run. Each company's facts from its own pages (TradersPost read 29 October 2026, PickMyTrade and CrossTrade re-read 11 November 2026), priced for five common setups.

Oct 29 · ProEA Lab

Explainer cover titled TradersPost vs PickMyTrade vs CrossTrade: a table of five setups priced per month on each bridge, from one futures account to Rithmic accounts in NinjaTrader 8, with three steps underneath: count your accounts, check your broker, test on paper first.

Best ATR Trailing Stop Indicators on TradingView (2026), Code-Read.

We read the code of the eight most-boosted open-source ATR trailing stop, Chandelier Exit and volatility stop scripts on TradingView: what each stop is built from, how it ratchets and flips, whether it decides on a closed candle, and what it alerts on.

Oct 27 · ProEA Lab

Explainer cover titled Best ATR trailing stops, code-read: a table of six open-source TradingView ATR trailing stop, Chandelier Exit and volatility stop scripts with ticks, crosses, halves and a dash for three checks: whether the script decides on a closed candle, whether its stop only tightens, and whether it alerts on the flip.