All indicators

Bollinger Bands - Custom moving average

Feb 5, 2021

Static chart image
SignalsMoving AveragesVolatility

The Bollinger Bands - Custom moving average indicator provides a flexible approach to volatility bands by allowing users to select from various moving average types for the basis of the calculation. This tool enhances the classic Bollinger Bands concept by enabling traders to substitute the standard Simple Moving Average (SMA) with more responsive or specialized averages to better suit specific market conditions.

Usage

The Bollinger Bands - Custom moving average can be used to identify potential overbought and oversold conditions, as well as period of high and low volatility. By changing the moving average type, users can adjust the sensitivity and lag of the bands:

  • Trend Following: Use "EMA" or "HMA" for a more responsive middle band that reacts quickly to price changes.
  • Mean Reversion: Use "SMA" or "DC" (Donchian Centerline) to identify deviations from a more stable central tendency.
  • Volume-Weighted Analysis: Use "VWMA" to incorporate volume data into the band calculations, making the bands more significant during high-volume price moves.

Traders can look for price tags or closes outside the bands to identify potential reversals, or observe the "squeeze" (narrowing of bands) to anticipate upcoming volatility breakouts.

Details

Standard Bollinger Bands are traditionally calculated using a 20-period Simple Moving Average (SMA) as the base, with upper and lower bands set at a specific number of standard deviations away from that SMA.

This implementation expands on that formula:

  • Middle Band: Uses the selected moving average type (e.g., SMA, EMA, WMA, HMA, RMA, VWMA, or DC).
  • Upper/Lower Bands: Calculated by adding/subtracting the standard deviation of the source price over the specified length, multiplied by the chosen multiplier, from the middle band.

This modularity allows the indicator to adapt to different trading styles—for example, using a Hull Moving Average (HMA) reduces lag significantly compared to the traditional SMA approach.

Settings

  • Source: Determines the price data used for the calculations (e.g., Close, Open, HL2).
  • Moving Average Type: Selects the calculation method for the middle band (EMA, SMA, HMA, RMA, VWMA, WMA, or Donchian Centerline).
  • Length: Sets the lookback period for both the moving average and the standard deviation calculation.
  • StdDev: Adjusts the multiplier for the standard deviation, controlling the width of the bands.

FAQ

How do I interpret the "DC" moving average type? The "DC" (Donchian Centerline) option calculates the midpoint between the highest high and the lowest low over the specified length, providing a non-averaging center point for the bands.

Can I set alerts for band crosses? Yes, the indicator includes built-in alert conditions for when the price crosses above the upper band or below the lower band.

How can I access this indicator? 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.