OPEN-SOURCE SCRIPT
BB Squeeze Histogram

BB Squeeze Histogram (BBSH) — User Manual
Companion indicator to Bollinger-Bands.Multi_Choice (BBMC). Plots the width of the Bollinger envelope as a MACD-style histogram, signed by which side of the basis MA price is on.
1. What It Shows
Two things are encoded into one histogram:
Above / below the neutral line — whether price is currently above or below the basis moving average. The neutral line is 0 in raw mode, 50 in normalized mode.
Bar length from the neutral line — how wide the Bollinger envelope currently is (the distance between the upper and lower band, at your chosen standard-deviation multiple). Long bars = wide bands = high volatility. Short bars hugging the neutral line = tight bands = low volatility / squeeze.
Put together, a bar answers two questions at once: which side of trend is price on, and how stretched or compressed is the market right now.
2. Reading the Colors
Bars use a 4-color scheme, same idea as a standard MACD histogram:
Color
Meaning
Bright teal
Above neutral, band width expanding vs. the prior bar
Pale teal
Above neutral, band width contracting vs. the prior bar
Bright red
Below neutral, band width expanding vs. the prior bar
Pale red/pink
Below neutral, band width contracting vs. the prior bar
Bright bars mean volatility is actively growing on that side of the trend. Pale bars mean the move is losing steam or the range is tightening — often the first sign a squeeze is building.
3. Extra Plots on the Panel
Neutral line — gray line at 0 (raw mode) or 50 (normalized mode). Crossings mark price crossing the basis MA.
Red line (Avg Positive Column) — the running average width of only the positive (above-neutral) bars, over the "Column average lookback" period. Shows what a "normal" bullish-side expansion looks like recently. Bars poking well above this line are expanding harder than usual.
Green line (Avg Negative Column) — same idea, mirrored for the negative (below-neutral) bars.
Yellow dots on the neutral line — squeeze markers. Appear when the current band width is the tightest reading over the "Squeeze lookback" period — i.e., the bands are as compressed as they've been in a while. These tend to precede expansion moves.
4. Inputs
Input
Default
What it does
Source
ohlc4
Price series used for the basis MA and standard deviation calc
Length
20
Lookback for both the basis MA and the standard deviation
Band SD (± this value)
3.0
The standard-deviation multiple defining the band edges (matches your BBMC R3/S3 by default)
ALMA offset
0.89
Only used if MA Type = ALMA
ALMA sigma
5
Only used if MA Type = ALMA
Normalize to 0-100 scale
off
See Section 5
Normalize rank lookback
200
Bars of width history the 0-100 rank is measured against (normalized mode only)
Squeeze lookback
100
Bars used to detect the "tightest width" for the yellow squeeze dots
Column average lookback
100
Bars used to compute the red/green average-column lines
MA Type
VWMA
Basis moving average type — SMA, EMA, RMA, WMA, VWMA, VWAP, HMA, SWMA, or ALMA
5. Normalize Toggle — Important
Off (default): the histogram plots raw dollar-width — literally (upper band − lower band). Values are in the same units as price, so a reading of "8,000" on BTC/USD means the envelope is $8,000 wide. The neutral line sits at 0.
On: the histogram is rescaled to a bounded 0–100 oscillator with 50 as the neutral level. The current band width is percentile-ranked against its own history over the "Normalize rank lookback" period (default 200 bars), producing a 0–100 rank. That rank is halved to a 0–50 magnitude and then measured out from 50 — upward when price is above the basis MA, downward when below.
Reading the normalized scale:
Reading
Meaning
Near 100
Price above the basis MA, band width at the widest end of its recent history
~75
Price above basis, width around the middle of its historical range
Near 50
Squeeze — width at the tightest end of its history, regardless of side
~25
Price below basis, width around the middle of its historical range
Near 0
Price below the basis MA, band width at the widest end of its recent history
Note that the distance from 50 is the volatility read and the side of 50 is the trend read — they are independent. A reading of 52 and a reading of 48 both describe a tightly squeezed market; they just differ on which side of the MA price closed.
Because the value is a percentile rank, it is self-scaling: readings are directly comparable across assets, timeframes, and price regimes without retuning. The trade-off is that it tells you where width sits relative to its own recent history, not its absolute size — a 95 reading in a quiet chop regime may be a smaller dollar-width than a 60 reading during a volatile stretch. Shortening the rank lookback makes the oscillator more reactive to recent regime; lengthening it gives a more stable long-run reference.
Match your basis MA type/length here to your BBMC settings if you want the neutral-line crossings on this panel to line up exactly with the white basis line's color flips on your main BBMC chart.
6. Suggested Ways to Use It
Trend confirmation: treat neutral-line position the same way you'd treat price vs. the BBMC basis line — histogram above neutral supports a long bias, below neutral supports a short bias.
Squeeze setups: watch for yellow dots (tight width) followed by a color shift from pale to bright — that transition often marks the start of a breakout move out of consolidation.
Exhaustion reads: when bars run well past the red or green average line, the current expansion is unusually large relative to its own recent history — often a point where trend continuation odds start to fade and mean-reversion becomes more likely.
Divergence: if price makes a new high/low but the histogram's peak height is smaller than the prior swing's, the expansion behind the move is weaker than last time — a classic momentum-divergence tell, same logic as reading MACD histogram divergence against price.
7. Notes / Limitations
This is a volatility/width indicator, not a standalone directional signal — it's meant to be read alongside price structure or your BBMC chart, not in isolation.
The squeeze marker and average-column lines both depend on their lookback inputs; shortening them makes the indicator more reactive to recent bars, lengthening them smooths it out but reacts slower to regime changes.
Normalize should generally stay consistent once you've picked it — the raw and normalized histograms are not on comparable scales, and the red/green average lines are computed from whichever mode is active. The squeeze dots are always derived from raw band width, so they mark the same bars in either mode.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Trading indicators:
tradingview.com/u/Options360/
tradingview.com/u/Options360/
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Trading indicators:
tradingview.com/u/Options360/
tradingview.com/u/Options360/
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.