# BandWidth

BandWidth is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

BandWidth plots Bollinger Band width normalized by the middle band, with reference lines marking the lowest (Squeeze) and highest (Bulge) readings of a 125-bar lookback and alerts when width enters either extreme or turns up off its low. A volatility-cycle gauge for traders timing compressions before directional moves and stretched width near trend endings.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 17, 2026.
- Access: free.
- Concepts: [BandWidth](https://www.luxalgo.com/library/concept/bandwidth/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=i56a1eqv9zdpo35ir7iv4l3l
- Page: https://www.luxalgo.com/library/indicator/bandwidth/

**BandWidth** is the definitive clean build of John Bollinger's [BandWidth](https://www.luxalgo.com/library/concept/bandwidth/) measure: the gap between upper and lower band as a fraction of the basis, plotted with a gradient fill above zero. Two reference lines track the lowest and highest readings of a configurable lookback (the Squeeze Level and Bulge Level), so the current width is always judged against its own recent extremes instead of an absolute level.

## How to Trade the BandWidth?

- **BandWidth at the Squeeze Level**: volatility is unusually compressed (a condition, not a direction) and the environment where directional moves are often born.
- **Expansion off the low**: the Expansion From Squeeze Low alert fires when width turns up from its lookback low, the moment compression starts resolving.
- **BandWidth at the Bulge Level**: width this stretched is rarely sustained and frequently appears near trend endings, a prompt to protect profits rather than initiate.
- **Direction comes from price**: pair the width read with price structure or a breakout tool; the metric itself is deliberately non-directional.

## BandWidth Settings

- **Length** (default 20): bars for the simple moving average basis and the standard deviation.
- **Source** (default close): price series the bands are computed from.
- **Multiplier** (default 2): standard deviation multiple, so the default bands sit four standard deviations apart.
- **Reference Lookback** (default 125): window locating the Squeeze and Bulge references, roughly six months of daily bars.
- **Show Squeeze Level / Show Bulge Level** (default on): plot the lookback low and high of BandWidth.
- **Extreme Markers** (default off): circles where BandWidth tags either reference; the alerts work regardless.
- **Gradient Fill** (default on): shades the area between zero and the BandWidth line.

## Frequently Asked Questions

### What is the difference between BandWidth and %B?

They are the two Bollinger-derived measures and answer different questions: [%B](https://www.luxalgo.com/library/indicator/percent-b/) reports where price sits relative to each band, while BandWidth reports the distance separating them. Squeeze hunting is a BandWidth job; judging stretch inside the envelope is a %B job.

### Why is the Reference Lookback 125 bars?

It approximates six months of daily sessions, the horizon Bollinger tied the Squeeze to. Shorter lookbacks flag squeezes more often but dilute how unusual each one is; longer ones reserve the label for rarer compressions.

### Can the Squeeze persist without a breakout?

Yes. Compression can grind on for weeks, printing fresh width lows while price does nothing. Treat the Squeeze reading as preparation rather than a countdown, and let the expansion alert or price itself confirm the cycle has turned.

## Related indicators

- [Nadaraya-Watson Envelope](https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope/) (Envelope): markdown at https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope.md
- [TTM Squeeze](https://www.luxalgo.com/library/indicator/ttm-squeeze/) (Volatility): markdown at https://www.luxalgo.com/library/indicator/ttm-squeeze.md
- [Fibonacci Bollinger Bands](https://www.luxalgo.com/library/indicator/fibonacci-bollinger-bands/) (Volatility): markdown at https://www.luxalgo.com/library/indicator/fibonacci-bollinger-bands.md
- [Double Bollinger Zones](https://www.luxalgo.com/library/indicator/double-bollinger-zones/) (Volatility): markdown at https://www.luxalgo.com/library/indicator/double-bollinger-zones.md
- [Proximal Range Filter](https://www.luxalgo.com/library/indicator/proximal-range-filter/) (Envelope): markdown at https://www.luxalgo.com/library/indicator/proximal-range-filter.md
- [Bollinger Squeeze](https://www.luxalgo.com/library/indicator/bollinger-squeeze/) (Volatility): markdown at https://www.luxalgo.com/library/indicator/bollinger-squeeze.md
- [Bollinger Bands Breakout Oscillator](https://www.luxalgo.com/library/indicator/bollinger-bands-breakout-oscillator/) (Bollinger Bands): markdown at https://www.luxalgo.com/library/indicator/bollinger-bands-breakout-oscillator.md
- [Donchian MA Bands](https://www.luxalgo.com/library/indicator/donchian-ma-bands/) (Donchian Channels): markdown at https://www.luxalgo.com/library/indicator/donchian-ma-bands.md

---

Source: https://www.luxalgo.com/library/indicator/bandwidth/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
