◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Indicators / Bollinger %B
Volatility indicator

Bollinger %B

A single number that states where price sits relative to the Bollinger Bands: 1 at the upper band, 0 at the lower, and beyond either when price escapes the bands.

Illustrative diagram — not live market data.

What it is

Bollinger %B, developed by John Bollinger as a companion to his Bollinger Bands, converts price's position within the bands into one normalized value. A reading of 1 means price is exactly at the upper band, 0 means exactly at the lower band, and 0.5 means at the middle band (the moving average). Crucially — and this answers the most common question about the tool — %B is not bounded: the bands do not contain price, so %B above 1 simply means price has closed above the upper band (more than the chosen number of standard deviations above the rolling mean), and %B below 0 means price has closed below the lower band. Neither reading is an error, and neither is a reversal signal; in strong trends price can ride outside a band while %B holds above 1 or below 0 for multiple bars. %B is a descriptive normalization of information already visible in the bands. It predicts nothing, we make no claim that any %B level implies mean reversion, and this entry is educational material, not financial advice — trading involves risk of loss.

How it works

Standard Bollinger Bands are built from a 20-period simple moving average of price (the basis) plus and minus 2 rolling standard deviations of the same price series. %B then measures where price falls within that envelope: %B = (price − lower band) / (upper band − lower band). When price equals the basis, the numerator is exactly half the denominator and %B reads 0.5. Because the standard deviation is recalculated each bar from the trailing window, both the band width and %B respond to recent volatility: the same absolute price move produces a larger %B change when the bands are tight than when they are wide. That adaptivity is the tool's point, but it has a mechanical consequence worth stating plainly — in a low-volatility squeeze the denominator becomes small, so %B gets hypersensitive and can swing from near 0 to near 1 on trivial price movement. A related honesty note: the '2 standard deviations' construction borrows the language of the normal distribution, but financial returns are not normally distributed, so %B above 1 must not be read as a statistically calibrated statement like 'a 5% tail event'. It means only that price is unusually far above its own recent rolling mean, by that window's own recent yardstick.

How traders read it

Common settings

The defaults inherit from standard Bollinger Bands: length 20, multiplier 2.0, source close. Longer lengths or larger multipliers make excursions beyond 0 and 1 rarer; shorter or tighter settings make them routine. Any change to the underlying band settings changes every %B value, so the settings should always be stated alongside readings.

Strengths

Pitfalls to watch

Pine v6 example

//@version=6
indicator("Bollinger %B Example", overlay = false)

length = input.int(20, "Length", minval = 1)
mult   = input.float(2.0, "StdDev Multiplier", minval = 0.1, step = 0.1)
src    = input.source(close, "Source")

basis = ta.sma(src, length)
dev   = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

// %B = position of price within the bands (can exceed 1 or drop below 0)
pctB = (src - lower) / (upper - lower)

plot(pctB, "%B", color = color.blue)
hline(1.0, "Upper Band (1.0)", color = color.gray)
hline(0.5, "Basis (0.5)", color = color.new(color.gray, 50))
hline(0.0, "Lower Band (0.0)", color = color.gray)

Pro tip: Always read %B together with band width: a %B of 1.1 during expanding, wide bands describes a genuinely strong move, while the same 1.1 during a tight squeeze may reflect a few pips against a tiny denominator. Logging how often your instrument's %B exceeds 1 or drops below 0 is also a quick, honest way to see that band breaches are routine events, not rarities. Educational context only — %B is descriptive, implies no mean reversion, and all trading carries risk of loss.

Built an indicator from this? Run it through the Validator to catch look-ahead bias and repainting, or convert a strategy to Pine Script.

Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro