All indicators

Double Moving Average

Nov 23, 2020

Static chart image
SignalsMoving Averages

The Double Moving Average indicator plots two distinct simple moving averages (SMA) within a single script to help traders identify trend direction and potential crossovers while maximizing available indicator slots on a chart.

Usage

The Usage section describes how the script can be used to identify market trends and momentum shifts. This tool is primarily utilized for crossover strategies, where the interaction between a shorter-term moving average (M1) and a longer-term moving average (M2) signals potential entry or exit points.

Traders can utilize the built-in presets for common trading strategies:

  • 7-21 or 11-22: Frequently used for short-term trend following and swing trading.
  • 50-200: The "Golden Cross" and "Death Cross" configurations used to determine long-term bullish or bearish market regimes.

By selecting the "Custom" option, users can define their own specific lengths to suit volatile or ranging market conditions. The indicator also includes built-in alert functionality that triggers when the two moving averages cross, allowing for automated monitoring of trend changes.

Details

The Double Moving Average script calculates two separate Simple Moving Averages based on the selected Source (typically the closing price). The calculation logic uses a conditional switch to determine the lengths of the averages based on the user's "Preset" selection. If a preset is chosen, the lengths are fixed to the designated values; if "Custom" is selected, the script pulls the values from the Custom M1 and Custom M2 inputs.

The indicator is designed for efficiency, consolidating two standard technical analysis tools into one. It identifies "Bullish Crosses" (when the shorter MA moves above the longer MA) and "Bearish Crosses" (when the shorter MA moves below the longer MA), which are standard signals for momentum shifts.

Settings

  • Preset: A dropdown menu allowing users to choose between common MA pairings (7-21, 11-22, 50-200) or a "Custom" mode.
  • Custom M1: Determines the period for the first moving average. This setting is only active when the Preset is set to "Custom."
  • Custom M2: Determines the period for the second moving average. This setting is only active when the Preset is set to "Custom."
  • Source: Specifies the price data used for the SMA calculations (e.g., Close, Open, High, Low).

FAQ

How does the Double Moving Average help with chart organization? By combining two moving averages into a single script, it allows traders on platforms with limited indicator slots to free up space for other technical tools like oscillators or volume profiles.

Can I use different types of moving averages like EMA or WMA? This specific version of the indicator is built using Simple Moving Averages (SMA). To use Exponential or Weighted averages, the underlying calculation logic in the script would need to be adjusted.

How can I access the Double Moving Average? 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.