Skip to main content
On this page

Bollinger Band Squeeze: Measure Compression and Test Breakouts

· 4 min read
Pineify Team
Pine Script and AI trading workflow research team

A Bollinger Band squeeze describes low recent volatility relative to a chosen history. It identifies compression, not a guaranteed large move, breakout direction or higher win rate. To test it, define the measurement and entry rule before inspecting outcomes.

Bollinger Bands Squeeze Indicator

Measure the Squeeze​

The Best Pine Script Generator

Traditional Bollinger Bands use an average with bands placed a selected number of standard deviations above and below it. A common starting configuration is a 20-period simple average with a multiplier of two. Those are defaults, not universally optimal settings.

BandWidth normalizes the band spread:

BandWidth = (upper band − lower band) ÷ middle band

Some implementations multiply this ratio by 100. Check the indicator's units before setting a threshold. A zero or near-zero denominator requires special handling for series where that can occur.

John Bollinger's BandWidth description describes a 125-period low as a squeeze criterion. Other lookbacks or percentile rules are alternative specifications that need their own evaluation. Do not label a 100-bar rule as the single standard definition.

Avoid the 95% Assumption​

Two standard deviations do not establish that 95% of future market prices will remain inside the bands. Bollinger's own usage rules caution against that statistical interpretation and distinguish band tags from standalone trading signals.

Compression can persist. A break can reverse, and a trending market can continue along a band. A narrow width measures recent dispersion; it does not prove stored “energy” or a minimum future move.

Configure a Reproducible Example​

Bollinger Band squeeze indicator builder in Pineify

In TradingView or a generated indicator, record length, source, deviation multiplier and offset. If using Pineify, inspect the generated formula and compare it with the intended definition.

For a test, you might define a squeeze as BandWidth reaching its lowest value over a specified lookback, then study the first confirmed close outside a band. This is an illustrative hypothesis. State whether the squeeze must have occurred on the same bar or within a recent window, and whether repeated closes create new entries.

Define Exits and Costs Before Testing​

Choose an entry timing, invalidation rule, stop, target, size and maximum holding period. A stop at the opposite band and a fixed reward-to-risk target are different choices to compare, not universal instructions. If the band moves, specify whether the stop moves with it or remains at the original level.

Include costs and gaps. A plotted stop does not enforce a broker order, and a stop order does not guarantee a particular fill price. Report the sample period and trade count with results.

Evaluate Filters Instead of Assuming Confirmation​

Volume, RSI or MACD can define additional conditions, but no filter certifies that a breakout is “real.” Check whether the volume field represents exchange volume, tick volume or is unavailable. Correlated price-derived indicators may add little independent information.

Compare the base rule and each filter on the same dataset, including the winning opportunities removed by the filter. Preserve a later period for evaluation and avoid repeatedly adjusting parameters after observing it. Do not tighten rules automatically because an arbitrary 20-trade window crossed a chosen win-rate threshold.

Does a squeeze predict direction?

No. It measures compression; direction requires a separately defined hypothesis.

Is a close outside the band a guaranteed breakout?

No. It is an observable event that can still reverse. Define risk and test the full rule.

Which timeframe or settings are best?

No single parameter set has been established as universally best. Compare plausible settings using the same data and costs, then evaluate unseen observations.

The Best Pine Script Generator