All indicators

Bollinger Bands With User Selectable MA

Sep 14, 2021

Static chart image
SignalsMoving AveragesVolatility

The Bollinger Bands With User Selectable MA indicator provides a highly customizable volatility envelope by allowing users to select from 12 different moving average types to calculate the basis and bands. This tool aims to give traders more control over how the bands react to price fluctuations, offering options ranging from traditional smooth calculations to highly reactive volatility-adjusted averages.

Usage

The tool can be used to identify trend direction, volatility expansion, and potential reversal points. By selecting different moving average types, traders can customize the sensitivity of the bands:

  • Trend Identification: Use smoother averages like SMA, EMA, or EHMA to identify the primary trend without excessive noise.
  • Volatility Analysis: Highly reactive averages like HMA or LSMA can be used to track price action more closely during high-volatility periods.
  • Mean Reversion: Traders can monitor band touches for potential "overheated" or "oversold" conditions, which are highlighted by optional candle coloring.
  • Customization: The indicator supports various MA types including TEMA, Tillson T3, ALMA, and Donchian Channels, each providing a unique perspective on price volatility.

Details

This script calculates the Bollinger Bands by first deriving a "Basis" line using the user's selected moving average. Unlike standard Bollinger Bands which typically rely on a Simple Moving Average (SMA), this implementation supports 12 variations. Standard deviation is then calculated and applied to this basis to form the upper and lower envelopes.

Supported Moving Average types:

  • SMA/EMA/WMA/VWMA: Standard traditional averages.
  • EHMA/HMA/TEMA: Fast, low-lag moving averages designed for quick response.
  • ALMA: Uses a Gaussian distribution to provide superior smoothing with minimal lag.
  • LSMA: Uses the least squares method to fit a linear regression line to the data.
  • Tillson T3: A sophisticated smoothing technique that reduces lag significantly.
  • Donchian: Uses the midpoint of the highest high and lowest low.

Settings

Bollinger Band Calculation Settings

  • Basis: Select the moving average type used for the center line and band calculation.
  • Source: The price data used for calculation (default is Close).
  • Period: The lookback period for the moving average and standard deviation.
  • # of Standard Deviations: Determines the width of the bands relative to the basis.
  • Basic Plot Offset: Shifts the entire indicator forward or backward on the x-axis.

Special MA Settings

  • LS Offset: Specific offset for the Least Squares Moving Average.
  • ALMA Offset/Sigma: Parameters to control the smoothing and responsiveness of the Arnaud Legoux Moving Average.
  • Tillson T3 Volume Factor: Controls the damping factor for the T3 calculation.

Color Settings

  • Modify Basis Color with trend?: Enables a gradient color for the basis line based on RSI levels.
  • Fill Bands Color with trend?: Fills the background between bands with a trend-responsive gradient.
  • Alternate Colors for Band Touch?: Changes the color of candles when they touch or exceed the bands.

FAQ

How do I access Bollinger Bands With User Selectable MA?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What is the advantage of using HMA over SMA for Bollinger Bands?

The Hull Moving Average (HMA) is much faster and reduces lag. Using it for Bollinger Bands allows the bands to stay tighter to price during fast moves, potentially identifying trend shifts earlier than a standard SMA.

Can I use this for mean reversion strategies?

Yes, by observing price touches on the upper or lower bands (highlighted by the candle coloring feature), traders can identify potential overextended price levels relative to the selected volatility model.

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.