Contents

Overview

The Double Moving Average (DMA) smooths one moving average with a second moving average.

Type, higher timeframe, offset, alerts, and full styling are all adjustable. The indicator includes an optional line and label to indicate the latest value of the DMA that repaints.

Concepts

Shorter term moving averages, especially in choppy markets, can rapidly increase and decrease their slope. Some traders read that steeper slope as a trend about to continue. By smoothing a moving average with another one, the magnitude of rapid choppy movements is mitigated.

It also works as a momentum filter: green-red long/short filtering cuts chop-driven whipsaws.

DMA customization

Each leg sets its own lookback length and moving average type. Available moving average types include:

  • Simple Moving Average
  • Exponential Moving Average
  • Hull Moving Average
  • Weighted Moving Average
  • Volume Weighted Moving Average

A bar offset setting is included for shifting the indicator's placement. Using different lookback combinations for both averages alongside an offset can create equivalent values of other types of moving averages not included in this indicator. For example, offsetting by 1 bar duplicates a 4 period centered moving average.

Colors for the DMA's plot can toggle between a single base color, or using increasing and decreasing colors. Changing the plot's style, line style, and width is also supported.

Latest Value Line and Label

The latest value of the DMA plot is replaced with a feature called the Latest Value Line and Label: a stylized line and label to help indicate the part of the indicator that can repaint from the parts that don't repaint. Data used to draw this feature is calculated separately from the indicator's confirmed historical calculations.

A label is included to display the latest value of the DMA which includes complete style settings. Toggling off the Latest Value Line and Label feature will cause all the respective style inputs to deactivate so that they're no longer in focus or editable until the feature is toggled on again.

Higher timeframes

Users can plot the DMA from higher timeframes on their chart.

As new bars print, the non-repainting DMA historical plot uses the last confirmed higher timeframe value. The repainting Latest Value Line and Label will update with the most recent higher timeframe value only for the latest bar. If the Latest Value Line feature is toggled off, the last confirmed higher timeframe DMA value is plotted up to the latest bar.

Note on the built-in SMA indicator: it plots values only on bars with higher timeframe close updates. Disabling Wait for timeframe closes to get values between updates causes repainting in both replay mode and realtime bars. Since the calculations that repaint are separate and optional in the DMA indicator, historical plotted values will not repaint in replay mode or on realtime bars while using higher timeframes.

Alerts

There are two DMA value options when creating an alert:

  • DMA Latest Value: the latest updating DMA value, the same value as the Latest Value Line.
  • DMA Last Confirmed Value: the DMA value from the latest confirmed historical bar.

Most alerts want the live line: the DMA Latest Value is the same value as the Latest Value Line, and most traders expect alerts when price crosses it.

When creating an alert you should see a Caution! warning saying the calculations can get repainted. This warning is intentional because the DMA indicator's Latest Value Line and Label feature is supposed to repaint to display the latest value.