All indicators

Better Bollinger Bands

Dec 16, 2019

Static chart image
Volume BasedChannelsMoving AveragesVolatility

The Better Bollinger Bands indicator is a comprehensive volatility tool that enhances standard Bollinger Bands through volume-weighted calculations, geometric scaling, and integrated trend oscillators. It aims to provide more responsive volatility envelopes that distinguish true outlier events from random price variation while maintaining statistical accuracy across different price scales.

Usage

The Better Bollinger Bands can be used as a primary volatility and trend analysis tool. Unlike standard bands, this script incorporates volume data into its moving average and standard deviation calculations, making the bands tighten or expand based on market activity.

Users can choose between different mathematical models:

  • Volume Weighting: When enabled, the bands respond to liquidity changes, helping to identify significant moves supported by volume.
  • Linear Regression Mode: By selecting "Use linear regression," the centerline transforms into a Least Squares Moving Average (LSMA). In this mode, the bands measure variance away from the regression line rather than a simple average, which is particularly effective for tracking assets in strong, steady trends.
  • Geometric Calculations: The script performs calculations on the log of the price. This ensures the bands remain proportional on logarithmic charts and prevents the lower band from ever reaching zero or negative values.

The tool also features integrated color schemes for the centerline and bands, allowing users to visualize momentum, RSI hysteresis, or market regimes (ranging vs. trending) directly on the price action.

Details

This indicator implements several advanced statistical concepts to improve accuracy:

  • Bessel Correction: The script applies appropriate Bessel corrections to various window types (Simple, Sawtooth/WMA, Exponential) to ensure the variance estimators remain unbiased, regardless of the chosen weighting.
  • Logarithmic Basis: By calculating volatility in log-space, the indicator treats percentage moves equally. A 5% move at a low price level creates the same relative band expansion as a 5% move at a high price level.
  • Integrated Oscillators: It includes a custom hybrid oscillator combining medium-term trends with RSI hysteresis to color the components, reducing the need for additional sub-pane indicators.

Settings

Main Settings

  • Length: The lookback period for the moving average and standard deviation calculations.
  • Multiplier: The number of standard deviations for the upper and lower bands.
  • Source: The price data used for calculations (e.g., HLC3, Close).
  • Time window: Choose between Simple, Sawtooth (WMA), or Exponential weighting for the window.
  • Use linear regression?: Switches the calculation from a moving average base to a linear regression base.
  • Ignore Volume?: Toggles the volume-weighting component of the calculations.

Visual Settings

  • Centerline color scheme?: Determines the logic for the centerline color (Centerline change, Momentum, RSI hysteresis, or Hybrid).
  • Band color scheme?: Determines the logic for the band color (Market type, Volatility Change, Centerline, or Plain).

FAQ

How do I use the Linear Regression option?

The linear regression option is best used during trending markets. It removes the "average momentum" from the volatility calculation, allowing the bands to wrap more tightly around the price trend.

What is the advantage of Geometric bands?

Geometric (logarithmic) bands are essential for assets that cover large price ranges or exhibit exponential growth, as they maintain consistent percentage-based widths and visual symmetry on log charts.

How can I access Better Bollinger Bands?

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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.