DEMA Double Exponential Moving Average Strategy

Sep 19, 2017

Static chart image
Signals
Moving 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 access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.