Forex
Indicator

Indicator: What Are Bollinger Bands? Trading Volatility

Last updated 2026-07-14

Bollinger Bands are a volatility indicator made of three lines plotted around price. They expand when the market gets more volatile and contract when it gets quieter, making them useful for reading both trend and volatility at the same time.

The Three Bands

  • Middle band — a simple moving average (usually 20-period), the baseline the other two bands are built from.
  • Upper band — the middle band plus 2 standard deviations of recent price.
  • Lower band — the middle band minus 2 standard deviations of recent price.

Because the bands are based on standard deviation, they automatically widen during volatile moves and narrow during quiet, range-bound periods. That self-adjustment is the whole point: a fixed "20 pips from the average" envelope would be meaninglessly tight on a volatile day and never touched on a quiet one, while a standard-deviation band always represents "unusually far from average for current conditions." Statistically, roughly 90-95% of price action stays inside 2-standard-deviation bands — so a touch of an outer band is by construction a fairly rare, stretched event.

The standard settings are 20, 2 (period, deviations). Widening to 2.5 or 3 deviations makes touches rarer and more significant; shortening the period makes the bands hug price more tightly. As with most indicators, the default is the setting the rest of the market is watching.

Entry Conditions

BUYSELLUpper / Lower bandMiddle band (SMA)
Entry conditions: BUY when price touches or pierces the lower band — SELL when price touches or pierces the upper band
  • BUY — price touches or pierces the lower band, suggesting it has stretched further than usual to the downside and may bounce back toward the middle band.
  • SELL — price touches or pierces the upper band, suggesting it has stretched further than usual to the upside and may pull back toward the middle band.

This is a mean-reversion trade, and it comes with a built-in target: the middle band, which is where "stretched" price reverts to. It works best in ranging conditions (see Trend vs Range) and works dramatically better with a filter: a lower-band touch that lands on a horizontal support level, or that coincides with an oversold RSI, is a much stronger candidate than a band touch alone. A candlestick rejection (like a Hammer at the lower band) as the trigger keeps you from buying a band that price is about to ride straight through.

In a steady trend, the middle band itself becomes the useful line — pullbacks in an uptrend frequently bounce off the 20-period average, giving trend traders an entry zone rather than a reversal signal.

The Squeeze

When the bands narrow tightly together, it's called a squeeze — volatility has dropped to unusually low levels, which often comes before a sharp breakout in either direction. Volatility is strongly cyclical: quiet periods breed explosive ones, and vice versa. Many traders watch for a squeeze as a sign that a big move may be building, without yet knowing which direction it will break.

The squeeze is traded as a breakout setup, the opposite logic of the band-touch trade: wait for price to close decisively outside the squeezed bands (often with a pending stop order beyond each side of the tight range), then trade in the breakout's direction. The classic trap is the head-fake — a first poke out of the squeeze that reverses and breaks the other way — which is why a confirmed close, not a wick, is the usual trigger.

A Word of Caution

In a strong trend, price can "ride the band" — repeatedly touching or hugging the upper (or lower) band for many candles in a row while the trend continues. This isn't a malfunction; a strong trend is a sustained statistical anomaly, and the band ride is what it looks like on this indicator. Treating every band touch as an automatic reversal signal is the classic way to lose money with Bollinger Bands — repeatedly selling a rising market one band-touch at a time. Check the trend first: if ADX is high and rising, or price has been closing outside/on the band for several candles with a steeply sloping middle band, treat band touches as trend strength, not reversal signals.

One more subtlety: the bands are reactive, not predictive — they widen because a big move already started, and a band touch tells you price is stretched, never when it will snap back.

Download the Indicator

This custom indicator plots the upper, middle, and lower Bollinger Bands, with automatic alerts when price touches either outer band. It's available for both MetaTrader 4 and MetaTrader 5 below.

How to Install — MetaTrader 4

  1. Download the bollinger-bands-alert.mq4 file below.
  2. Open MetaTrader 4 → click FileOpen Data Folder.
  3. Place the file in the MQL4/Indicators folder.
  4. Restart MetaTrader 4, then drag the indicator from the Navigator window onto the chart.

How to Install — MetaTrader 5

  1. Download the bollinger-bands-alert.mq5 file below.
  2. Open MetaTrader 5 → click FileOpen Data Folder.
  3. Place the file in the MQL5/Indicators folder.
  4. Restart MetaTrader 5, then drag the indicator from the Navigator window onto the chart.

Both files are source code — open and review the full code before using it, for your own safety.

Download bollinger-bands-alert.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download bollinger-bands-alert.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File