Bollinger Bands
Jun 12, 2015

The Bollinger Bands indicator provides a visually enhanced perspective on price volatility by displaying two distinct standard deviation levels and a trend-responsive basis line. This tool allows traders to identify potential overextended price conditions and trend shifts through multi-layered bands and dynamic coloring.
Usage
The Usage section describes how this indicator can be applied to technical analysis. Traders use these bands to gauge market volatility and potential reversal zones.
- Standard Deviation Levels: The indicator plots two levels of standard deviations. The first level (1 StdDev) is often used to identify the core trading range, while the second level (customizable via multiplier) marks significant price extensions.
- Trend Identification: The basis line (Simple Moving Average) changes color based on the price position relative to the mean. When price is above the basis, the line turns green (bullish), and when below, it turns red (bearish).
- Volatility Squeezes: Like traditional Bollinger Bands, the narrowing of the bands suggests low volatility and potential upcoming price breakouts, while widening bands indicate increased volatility.
Details
This script builds upon the traditional Bollinger Band formula but introduces a dual-level visualization.
- Basis: Calculated as a Simple Moving Average (SMA) of the selected source over a specific period.
- Band Calculation: The first set of bands is calculated at 1 standard deviation from the basis. The second set uses the user-defined multiplier (defaulting to 2.0) applied to the standard deviation.
- Visual Logic: The areas between the basis and the outer bands are filled with color-coded backgrounds to provide an immediate sense of whether the price is trading in a bullish or bearish volatility zone.
Settings
- Source: Determines the price data used for calculations (e.g., Close, Open, High, Low).
- Length: The lookback period used for the Simple Moving Average and Standard Deviation calculations.
- Multiplier: The value used to calculate the outer (second) standard deviation bands.
FAQ
How do I interpret the colored basis line?
The basis line turns green when the current price source is above the moving average, suggesting a bullish bias, and red when the price is below, suggesting a bearish bias.
What is the difference between the dotted and solid bands?
The dotted (circular style) bands represent the 1st Standard Deviation, while the solid lines represent the 2nd Standard Deviation (or the value set in the Multiplier setting).
Where can I find more tools like this?
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.