All indicators

DEMA Double Exponential Moving Average Strategy

Sep 19, 2017

Static chart image
SignalsMoving Averages

The DEMA Double Exponential Moving Average Strategy indicator provides a trend-following trading framework that utilizes the reduced lag of the DEMA calculation to identify market entries and exits with high responsiveness. By comparing two DEMA lines calculated across user-defined timeframes, this tool aims to capture momentum shifts more efficiently than standard moving averages.

Usage

The Usage section focuses on identifying trend reversals through the interaction of two specific DEMA calculations. Traders typically monitor the "Fast" and "Slow" DEMA lines to determine market bias and potential execution points.

  • Trend Identification: When the shorter-term (Slow) DEMA is positioned above the longer-term (Fast) DEMA, the strategy identifies a bullish environment. Conversely, when the Slow DEMA resides below the Fast DEMA, it indicates a bearish environment.
  • Crossover Signals: A "Buy" signal is generated when the Slow DEMA crosses above the Fast DEMA. A "Sell" signal is generated when the Slow DEMA crosses under the Fast DEMA.
  • Multi-Timeframe Analysis: The strategy allows users to calculate DEMA values from a higher timeframe (Resolution) and project them onto the current chart. This is often used to filter out minor price fluctuations and focus on broader market trends.

To maintain signal integrity and avoid repainting, it is recommended to view the strategy on a chart resolution that is at least half of the "Resolution" parameter setting (e.g., if the Resolution is set to 120, the chart timeframe should be 60 minutes or higher).

Details

The Double Exponential Moving Average (DEMA) was developed to provide a moving average with less lag than a traditional Exponential Moving Average (EMA). It achieves this by calculating the EMA of an EMA and subtracting it from a doubled initial EMA: $DEMA = (2 \times EMA) - (EMA \text{ of } EMA)$.

In this specific implementation, the script uses request.security to fetch DEMA data from a specified resolution. This allows the strategy to execute based on higher-level trend data regardless of the current chart's timeframe. The logic evaluates crossovers on the previous bar's closed data to ensure that signals are confirmed before the strategy executes a trade or triggers an alert.

Settings

  • DEMA FAST Period: Sets the lookback window for the longer-period DEMA calculation (default is 17).
  • DEMA SLOW Period: Sets the lookback window for the shorter-period DEMA calculation (default is 9).
  • Resolution: Determines the timeframe from which the DEMA calculations are sourced. It is recommended to keep this value equal to or higher than the current chart timeframe to prevent visual inconsistencies.

FAQ

How do I interpret the background colors on the chart? Green background highlights indicate a bullish crossover (Buy), while red background highlights indicate a bearish crossover (Sell). Faded background colors represent the ongoing trend direction based on the current DEMA positioning.

What are the best settings for BTCUSD? Based on historical testing, effective configurations for BTCUSD include a Resolution of 120 with a Slow Period of 2 and a Fast Period of 32, or a Resolution of 60 with a Slow Period of 1 and a Fast Period of 67.

How do I get access to the DEMA Double Exponential Moving Average Strategy? 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.