Percentile Rank of Bollinger Bands
Sep 23, 2022

The Percentile Rank of Bollinger Bands indicator provides a comprehensive view of volatility and price positioning by analyzing the width of Bollinger Bands relative to historical data. It aims to help traders identify periods of extreme expansion or contraction (squeezes) and visualize where the current price sits within the bands.
Usage
The tool can be used to determine the intensity of market volatility and the likelihood of mean reversion or trend continuation.
- Volatility Ranking: The thick line represents the percentile rank of the current band width compared to a user-defined lookback period. A rising green line indicates increasing relative volatility, while a falling red line indicates diminishing relative volatility. Values near 100 suggest the bands are historically wide, while values near 0 suggest a significant squeeze.
- Price Positioning: The thin line shows the relative height of the price between the upper and lower bands. A value of 100 represents the upper band, and 0 represents the lower band. Movements above 100 or below 0 indicate the price has broken outside the Bollinger Bands.
- Standard Deviation Histogram: The columns at the bottom display the raw standard deviation percentage. Taller, darker columns signify expanding width, whereas shorter, lighter columns signify narrowing width.
Details
The indicator calculates the current band width by dividing the standard deviation by the current price. To determine the Percentile Rank, it compares this width against an array of historical width values over a specific lookback period. This transformation allows traders to see not just that volatility is changing, but how significant that change is in a historical context. The relative height calculation uses the formula (close - lower) / (upper - lower) to normalize the price position within the volatility envelope.
Settings
Bollinger
- Length: The number of bars used to calculate the basis (SMA) and standard deviation for the Bollinger Bands.
- Source: The price data point used for calculations (default is Close).
- StdDev: The multiplier applied to the standard deviation to determine the width of the bands.
Ranking
- Stdev Rank Lookback: The historical window size (in bars) used to calculate the percentile rank of the current band width.
Display
- Show Boll Stdev %: Toggles the visibility of the histogram representing the raw standard deviation width.
- Show Current Price's Relative Height in Band: Toggles the visibility of the thin line representing the price's position relative to the bands.
FAQ
How do I interpret the Percentile Rank line?
The Percentile Rank line indicates how the current volatility compares to the last N bars. High values (above 95) suggest the market is extremely volatile or overextended, while low values (below 5) suggest a volatility squeeze which often precedes a major price move.
What does it mean if the Relative Height is above 100?
If the Relative Height line is above 100, it means the current closing price is higher than the upper Bollinger Band. Conversely, a value below 0 means the price is below the lower band.
How can I access this tool?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.