# %B

Also known as: percent B, Bollinger %B.
A Volatility concept (Band & channel systems) in the LuxAlgo Library, with 1 indicator implementation.

## What is %B?

%B is John Bollinger's companion statistic to his bands: it expresses where price sits within [Bollinger Bands](https://www.luxalgo.com/library/concept/bollinger-bands/) as a single number, computed as (price - lower band) divided by (upper band - lower band). A value of 1 puts price exactly at the upper band, 0 at the lower band, and 0.5 at the middle band; readings above 1 or below 0 mean price is outside the bands, which the formula permits because %B is not hard-bounded. With standard two-standard-deviation bands, %B amounts to a shifted and scaled version of the [z-score](https://www.luxalgo.com/library/concept/z-score/) of price against its lookback mean: the z-score divided by four, plus one half.

The point of %B is normalization. Raw price at the upper band means different things on different charts, but %B = 1 means the same thing everywhere: price sits exactly at the upper band for the settings in use. That makes band position comparable across symbols and timeframes, chartable as an oscillator, and usable as an input to screens and systems. Interpretation stays regime-dependent, though: in a range, extreme %B suggests stretch; in a trend, price can walk the band and hold %B near 1 for many bars, where high readings mark strength rather than an imminent [reversal](https://www.luxalgo.com/library/concept/reversal/).

## How to calculate %B

%B is derived entirely from Bollinger Bands, so the band settings determine everything downstream.

1. Compute Bollinger Bands with your chosen settings; the default is a 20-period simple moving average with bands at plus and minus 2 standard deviations.
2. Apply the formula: %B = (price - lower band) ÷ (upper band - lower band), typically using the close.
3. Read the scale: 1 means price is at the upper band, 0.5 at the middle band, 0 at the lower band; above 1 or below 0 means price is outside the bands.
4. Plot it as an oscillator beneath the chart, which makes band position, its trend, and its divergences easier to see than on the price panel.

## How traders use it

- As a normalized [overbought/oversold](https://www.luxalgo.com/library/concept/overbought-oversold/) gauge in ranging markets: %B near its extremes flags band tags that mean-reversion approaches fade, with the standing caveat that trends can pin %B at an extreme for long stretches.
- For Bollinger's W-bottom and M-top patterns: a second price low that undercuts the first while %B holds a higher low shows the retest happened closer to or inside the bands, a volatility-adjusted form of [divergence](https://www.luxalgo.com/library/concept/regular-bullish-bearish-divergence/).
- As trend confirmation: sustained high readings (price walking the upper band) indicate persistent strength, so some systems require %B to stay above a threshold to remain long rather than treating extremes as fades.
- As a machine-readable input: because %B compresses price-versus-bands into one roughly unit-scaled number, it slots cleanly into screeners, scoring systems, and model features.

## %B vs related concepts

- **BandWidth** (https://www.luxalgo.com/library/concept/bandwidth/): Bollinger's other derived statistic: BandWidth measures how wide the bands are (volatility), while %B measures where price sits within them (position). The two are complements, not substitutes.
- **Stochastic Oscillator** (https://www.luxalgo.com/library/concept/stochastic-oscillator/): Also a position-within-a-range measure, but the range is the lookback's highest high to lowest low, so it is hard-bounded between 0 and 100. %B locates price within statistical bands and can exceed its nominal bounds.
- **Z-score** (https://www.luxalgo.com/library/concept/z-score/): With default bands, %B is an affine rescaling of the z-score of price. The z-score speaks in standard deviations directly; %B speaks in band-relative units traders already watch on the chart.

## FAQ

### What does it mean when %B is above 1 or below 0?

It means price is outside the Bollinger Bands: above the upper band for readings over 1, below the lower band for readings under 0. That is statistically uncommon but not automatically a reversal signal; strong trends routinely produce a series of such readings while price walks the band. Trend and structure context decide how to treat them.

### Is %B the same as the stochastic oscillator?

No, though both express position within a range. The stochastic uses the absolute highest high and lowest low of its lookback, so it is bounded between 0 and 100. %B uses statistical bands built from a moving average and standard deviation, so its frame recenters and rescales with volatility, and readings can exceed 1 or fall below 0.

### What is a %B divergence?

A mismatch between price extremes and %B extremes. In Bollinger's W-bottom, price makes a lower low while %B makes a higher low, meaning the second low sat closer to or inside the bands after volatility adjustment. The same logic mirrors at tops. It flags fading pressure but, like any divergence, calls for confirmation before acting.

## Implementations in the Library

- %B (LuxAlgo): https://www.luxalgo.com/library/indicator/percent-b/

## Related concepts

- Donchian Channels: https://www.luxalgo.com/library/concept/donchian-channels/
- Envelope: https://www.luxalgo.com/library/concept/envelope/
- Bollinger Bands: https://www.luxalgo.com/library/concept/bollinger-bands/
- BandWidth: https://www.luxalgo.com/library/concept/bandwidth/
- Bollinger Squeeze: https://www.luxalgo.com/library/concept/bollinger-squeeze/
- Band Walk: https://www.luxalgo.com/library/concept/band-walk/
- Bollinger Band Tag Reversion: https://www.luxalgo.com/library/concept/bollinger-band-tag-reversion/
- Double Bollinger Zones: https://www.luxalgo.com/library/concept/double-bollinger-zones/
- Fibonacci Bollinger Bands: https://www.luxalgo.com/library/concept/fibonacci-bollinger-bands/
- Keltner Channels: https://www.luxalgo.com/library/concept/keltner-channels/

---

Source: https://www.luxalgo.com/library/concept/percent-b/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/