All indicators

Bollinger Bands Contraction and Expansion

Jul 1, 2019

Static chart image
Dynamic OverlaysSignalsVolatility

The Bollinger Bands Contraction and Expansion indicator identifies periods of low and high volatility by monitoring the distance between bands, helping traders spot potential breakouts or consolidation phases.

Usage

This indicator is primarily used to identify "squeezes" and "expansions" in market volatility. When the Bollinger Bands contract significantly, the background and bands change color to green, signaling a period of low volatility where price action is tightly bound. This often precedes a significant directional move or "breakout." When the bands widen beyond a specific threshold relative to the basis, the indicator switches to red, signaling a state of expansion or increased volatility.

Traders can use these visual cues to:

  • Anticipate market breakouts during green (contraction) phases.
  • Identify established trends or high-volatility environments during red (expansion) phases.
  • Set alerts for when a contraction or expansion begins to automate their monitoring process.

Details

The indicator calculates standard Bollinger Bands using a Simple Moving Average (SMA) and standard deviation. The core logic for determining contraction is based on a comparison between the total band width (Upper Band - Lower Band) and a percentage of the basis (SMA).

Specifically, the script considers the bands "contracted" if the distance between the upper and lower bands is less than 9% of the basis value. This mathematical approach provides a standardized way to define a "squeeze" across different asset classes and price levels.

Settings

Basic Settings

  • Length: The lookback period used for the Simple Moving Average (basis) and the standard deviation calculation.
  • Source: The price data used for calculations (typically the closing price).
  • Multiplier: The number of standard deviations applied to the basis to create the upper and lower bands.

FAQ

How do I interpret the colors?

Green bands and background indicate a "Contraction" phase (low volatility), while red bands and background indicate an "Expansion" phase (high volatility).

Can I set alerts for volatility changes?

Yes, the script includes built-in alert conditions for both "Contraction Started" and "Expansion Started," which trigger when the indicator switches states.

How can I access this indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.