The Double Exponential Moving Average is one of the most underappreciated tools in an algorithmic trader’s arsenal. Most traders know the Simple Moving Average and the Exponential Moving Average. The DEMA takes responsiveness further by dramatically reducing lag. For systematic traders looking to capture trends earlier and exit faster, the Double Exponential Moving Average is essential.
What Is the Double Exponential Moving Average?
The Double Exponential Moving Average (DEMA) is a technical indicator that applies exponential smoothing twice. The result is a moving average with far less lag than a standard EMA. Patrick Mulloy created it in a 1994 article published in Technical Analysis of Stocks & Commodities magazine. His goal was simple: build a moving average that reacts faster without adding noise.
The core idea behind the Double Exponential Moving Average is elegant. DEMA calculates an EMA of the price, then calculates an EMA of that EMA. It combines them using a specific formula: DEMA = 2 × EMA(n) − EMA(EMA(n)). This construction cancels out much of the lag found in a single EMA.
The result is a moving average that hugs price action more closely. This makes it valuable for trend-following strategies where early detection of directional changes matters. The DEMA turns sooner when price reverses direction. It also stays closer to price during strong trends.
How Is the DEMA Calculated?
Understanding the Double Exponential Moving Average calculation helps traders appreciate why it behaves the way it does. The process involves two steps, followed by a combination step.
Step one: Calculate the standard Exponential Moving Average over your chosen period. For a 21-period DEMA, you first compute a 21-period EMA of the closing price. This gives you a smoothed price series, but one that still carries noticeable lag.
Step two: Take that EMA and compute another EMA of it using the same period. This is the “double-smoothed” EMA. It is even smoother but carries even more lag.
Step three: Combine the results. Multiply the first EMA by two, then subtract the double-smoothed EMA. The formula is: DEMA = (2 × First EMA) − Second EMA. Subtracting the extra-lagged component removes a large portion of the delay. The smoothing benefit is preserved.
The period setting controls how many bars the indicator considers. Shorter periods like 10 or 14 react quickly but may generate more false signals. Longer periods like 50 or 100 filter out noise but respond more slowly to genuine trend changes. Most algorithmic traders test periods between 10 and 50 to find the right balance.
How to Read DEMA Signals?
Reading the Double Exponential Moving Average follows the same principles as other moving averages. The key advantage is that signals arrive sooner due to reduced lag.
Price position relative to DEMA: When price trades above the DEMA line, the market is bullish. When price drops below, bearish momentum is in control. These crossings can serve as entry and exit triggers. The DEMA sticks closer to price than a standard EMA, so signals fire earlier.
DEMA crossovers: A popular approach uses two DEMAs with different periods — a fast one and a slow one. When the fast DEMA crosses above the slow DEMA, it generates a bullish signal. A cross below signals bearish momentum. This dual-DEMA system is a staple of systematic trading. It is objective, repeatable, and easy to automate.
DEMA slope direction: The angle of the DEMA line itself conveys useful information. A rising DEMA suggests strengthening bullish momentum. A flattening or declining DEMA indicates weakening or reversing trends. Traders use slope changes as early warnings to tighten stops or reduce size.
What Are the Best DEMA Trading Strategies?
The Double Exponential Moving Average lends itself to several proven frameworks. Here are three approaches that algorithmic traders commonly build and backtest.
Trend following with price versus DEMA: The simplest strategy uses a single DEMA as a trend filter. Enter long when price closes above the DEMA. Exit when price closes below it. A 21-period DEMA on a 4-hour chart can capture multi-day swings while filtering intraday noise. This works best in trending markets.
Dual DEMA crossover: This strategy uses two DEMA lines — for instance, a 10-period and a 50-period. When the fast DEMA (10) crosses above the slow DEMA (50), go long. When it crosses below, exit or open a short. Because both lines are DEMAs, crossover signals arrive earlier than with traditional EMAs. This reduced lag improves entry timing during strong trend starts.
DEMA combined with RSI filter: Adding a Relative Strength Index filter helps avoid buying into overbought conditions. Only take long signals when price crosses above the DEMA and RSI is below 70. Only short when price crosses below and RSI is above 30. This reduces trade count but improves win rate by filtering signals at price extremes.
What Are Common DEMA Mistakes to Avoid?
Even experienced traders make errors with the Double Exponential Moving Average. Awareness of these pitfalls saves capital.
Using too short a period: The DEMA is already faster than a standard EMA. Very short settings like 5 or 7 make it hypersensitive to price fluctuations. This leads to excessive whipsaws that erode profits through costs and slippage. If your strategy generates too many signals, increase the period.
Ignoring ranging markets: The Double Exponential Moving Average struggles in sideways or choppy conditions. Price oscillating around the DEMA line generates a series of false signals. Consider adding a volatility filter like the Average Directional Index (ADX). Pause trading when the market lacks a clear trend.
Not combining with other indicators: Relying on the DEMA alone ignores valuable volume, momentum, and volatility data. Layer it with at least one confirming indicator from a different category. Volume confirmation, RSI divergence checks, or Bollinger Band squeeze filters all improve performance.
Confusing DEMA with TEMA: The Triple Exponential Moving Average (TEMA) is related but distinct. Both reduce lag, but they use different formulas and behave differently at turning points. Make sure you apply the correct indicator in your strategy.
How to Build DEMA Strategies in Arrow Algo?
Arrow Algo makes it straightforward to build Double Exponential Moving Average strategies. Use the visual block builder — no coding required.
Start by dragging a Data Watcher block onto your canvas. Configure it for your chosen pair and timeframe. Connect the close price output to a DEMA block. Set your desired time_period — for example, 21 for a medium-term filter.
Add a Condition block that compares current close price against the DEMA output. Set it to trigger on crosses above for buy signals and below for sell signals. Connect the output to an Action block to execute trades automatically.
For a dual DEMA crossover, add two DEMA blocks to your canvas. Connect both to the same Data Watcher but with different period settings — perhaps 10 and 50. Use a Condition block to detect when the fast DEMA crosses the slow DEMA. This drag-and-drop approach builds crossover systems in minutes.
Want to add an RSI filter? Drop an RSI block onto the canvas and connect it to the same Data Watcher. Add a Condition block to check RSI is within your range. Chain multiple conditions so your strategy only trades when all criteria align.
Once wired up, run a backtest on historical exchange data to test your Double Exponential Moving Average strategy. Adjust periods, tweak conditions, and iterate until you find settings that match your goals. All without writing a single line of code.
What Are the Key Takeaways?
- The DEMA reduces lag by applying exponential smoothing twice. The formula is DEMA = 2 × EMA − EMA(EMA).
- Patrick Mulloy created it in 1994 to address the lag problem in traditional moving averages.
- Price crosses, dual DEMA crossovers, and slope changes all provide signals that arrive earlier than EMA equivalents.
- Avoid very short DEMA periods. The indicator is already faster than an EMA, and short settings amplify noise.
- Combine the DEMA with confirming indicators like RSI, volume, or volatility filters for more robust strategies.
- Arrow Algo’s visual block builder lets you create and backtest DEMA strategies with no programming required.
Disclaimer: The information provided in this article is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.
Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who’ve made the switch to systematic trading.
