Article

Double Exponential Moving Average: How It Works & How to Use It

DEMA reacts faster than a normal moving average, sometimes flagging a trend change bars before an EMA would. Here's how it's built, how to trade the crossovers, and where that speed starts working against you.

Key Takeaways

  1. DEMA reacts faster than a standard EMA. It runs an EMA twice over the same period and subtracts the extra lag out, so it confirms a trend change with fewer bars of delay.

  2. Patrick Mulloy built it in 1994 to solve the lag every earlier moving average carried, publishing the method in Technical Analysis of Stocks & Commodities.

  3. The standard crossover pair is 20 and 50 periods, with 9 or 21 used for fast intraday reads and 200 used for the long term trend bias.

  4. DEMA still lags the price as it confirms a move that has already started rather than predicting one, and it throws off more false signals once the market stops trending.

  5. A worked example below shows the arithmetic, and a failure case shows what a run of false crossovers costs in a ranging market. 

The Double Exponential Moving Average (DEMA) is a technical indicator that tracks price trends with less delay than a standard moving average, by running an EMA twice over the same period and subtracting the extra lag out. This article covers how DEMA is calculated, with a worked example, and how traders read it for crossovers, support and resistance, and common settings. It also covers where DEMA falls short, with a worked failure case from a ranging market.

What Is the Double Exponential Moving Average (DEMA)?

The Double Exponential Moving Average, or DEMA, is a moving average that cuts the lag of a standard Exponential Moving Average (EMA) by running an EMA twice over the same period and subtracting the extra lag out. Double Exponential Moving Average is the full form of DEMA, and traders use the two terms interchangeably once the topic is clear from context.

Patrick Mulloy introduced DEMA in 1994 in Technical Analysis of Stocks & Commodities Magazine. He built it to solve a problem of every moving average shares, that it only confirms a trend after price has already moved. A trader relying on a standard EMA in a fast move can lose several bars, and several bars can mean entering well after the best of the move has already passed.

DEMA sits at the fast end of the moving average family, faster than an EMA and much faster than an SMA of the same period. The comparison section below sets out exactly how much faster, and what that speed costs in false signals.

DEMA confirms a move that has already started. It does not predict where the price is going next.

How DEMA Is Calculated

The formula is DEMA = (2 × EMA) − EMA(EMA), both taken over the same period.

Running the EMA a second time captures how much lag is still built into the first line. Subtracting that second EMA, rather than adding it, is what cancels the lag out instead of piling more smoothing on top.

The table below walks through a 5 period DEMA over sixteen bars of a rising price.

   
BarCloseEMA (5)EMA of EMA (5)DEMA (5)DEMA minus EMA
1100



2101.2



3100.8



4102.4



5103101.48


6104.1102.35


7103.6102.77


8105.2103.58


9106104.39102.91105.861.47
10105.4104.72103.52105.931.21
11107.1105.52104.18106.851.33
12108.3106.44104.94107.951.51
13107.6106.83105.57108.091.26
14109.4107.69106.27109.11.41
15110.2108.52107.02110.021.5
16111109.35107.8110.91.55

Take the last row by hand. At bar 16 the close is 111.00, the 5 period EMA reads 109.35, and the EMA of that EMA reads 107.80. Two times 109.35 is 218.70, minus 107.80 gives 110.90, which is the DEMA reading in the table. DEMA sits about 1.55 closer to the actual close than the plain EMA does.

Both lines in the table are seeded before they can be calculated properly. The EMA (5) starts at bar 5, as a simple average of the first five closes. The EMA of EMA starts at bar 9, as a simple average of the first five EMA values. That is why both columns start blank.

In practice, nobody works this out by hand. The trading platform runs the calculation the moment DEMA is added to a chart.

A DEMA also needs a certain number of bars of price history before the line means anything, roughly two times the period minus one. A 20 period DEMA wants about 39 bars of data, which is also why the columns above start late.

How to Use the DEMA Indicator

DEMA tells a trader the direction of the current trend, and it confirms that direction sooner than an EMA of the same period would. On its own it says nothing about how strong the move is or how long it will last, so DEMA is read alongside other tools, never alone.

DEMA Crossovers as Trend Signals

Two crossovers get read on a DEMA line.

The first is price against a single DEMA. A close above the line suggests the short term trend has turned up, and a close below suggests it has turned down. On its own this only suggests a shift, it does not confirm one. A trader typically wants the next bar or two to hold on the same side of the line before treating the cross as real.

The second is a faster DEMA crossing a slower one, most commonly a 20 period DEMA crossing a 50 period DEMA. A 20 crossing above the 50 suggests the shorter term trend has turned bullish against the longer one, and a cross below suggests the opposite. This reads as a stronger signal than a single line cross, because two different speeds are agreeing, but it still needs the same follow through before a trader acts on it.

A DEMA cross fires earlier than the same cross would on an EMA of the same period, often by two to four bars on a clean trending move. That earlier signal cuts both ways. It gives an earlier entry when the move holds, and it gives an earlier false signal when the move does not.

Using DEMA as Support and Resistance

Traders read a DEMA line as support and resistance while the market is trending. In an uptrend, the DEMA line often acts as a moving floor. Price pulls back toward it and then continues higher, and traders watch for that bounce as a place to add to a position or enter one. In a downtrend the same line acts as a moving ceiling, with price rallying up to it and turning back down.

Because DEMA reacts faster than an EMA of the same period, it hugs price more closely, so the floor or ceiling it draws sits tighter to current price than an EMA equivalent would. That tighter fit is useful in a clean trend and a liability once the trend stops. In a sideways market these levels get broken constantly, which is exactly what happens when DEMA throws off false signals.

Common DEMA Settings and Periods

Traders reach for a handful of periods on DEMA. A 9 or 21 period DEMA suits fast intraday work, where a trader wants the earliest possible read on a short move. A 20 and 50 period pair is the standard crossover setup, used to catch a shift between a shorter term and longer term trend. A 200 period DEMA is read for the long term bias, whether the broader market sits above or below it.

A 20 DEMA is a DEMA calculated over 20 periods, most often used on daily or hourly charts to time entries against the medium term trend.

As the period lengthens, the line smooths out, its signals arrive later, and it throws off fewer false ones. A 200 DEMA carries this furthest. It moves slowly enough that a cross against it is treated as a signal about the broader trend, not a timing trigger for a single trade.

Which Markets and Timeframes Can DEMA Be Used On?

DEMA can be applied to forex, share, index, commodity and cryptocurrency price charts. Traders may also use it when trading CFDs based on these underlying markets. The calculation does not change between markets because DEMA uses the selected instrument’s price data.

Shorter DEMA periods are more responsive and may suit intraday charts, while longer periods provide smoother trend information for swing or position analysis. The most suitable period depends on the instrument’s volatility, the chart timeframe and the trader’s strategy rather than whether the instrument is traded directly or through a CFD.

DEMA vs EMA: What Is the Difference?

The one difference that matters between DEMA and EMA is timing. Over the same period, DEMA reacts to price sooner than EMA, because the lag carried by the second EMA is subtracted out of the calculation rather than layered on top of it.

   
AspectSMAEMADEMA
How the line is builtEvery close in the period counts equallyRecent closes count for more than older onesAn EMA, then an EMA of that EMA, with the extra lag subtracted out
FormulaSum of closes divided by the number of periodsBuilt from the previous EMA plus a weighting on the latest close(2 x EMA) minus the EMA of that EMA, same period for both
Lag behind priceMostLess than SMALeast of the three
Reaction to a sharp moveSlowestFasterFastest
Signals in a sideways marketFewestMoreMost, and the highest share of them false
Usually read forThe long term trend backdropTrend confirmation on swing timeframesTiming on short term and intraday charts
Main drawbackSignals arrive lateStill lags in a fast moveWhipsaws when the market stops trending

Which one a trader reaches for tracks the holding period more than personal preference. A trader holding a position for months leans on an SMA or a long period EMA for the backdrop. A swing trader confirming a multi day move reaches for an EMA. A trader timing entries on a short holding period reaches for DEMA, where the faster read is worth more than the extra noise.

The trade off is plain once it is stated. What a trader gains in earlier timing with DEMA, they pay for in false signals when the market is not trending cleanly. None of the three is better than the others, each fits a different holding period and a different tolerance for false signals.

For the fuller comparison between the other two on their own, see EMA vs SMA.

Advantages and Limitations of DEMA

Advantages of Using DEMA

DEMA carries three advantages over a standard EMA of the same period.

  • Lower lag: The lower lag confirms a trend change with fewer bars of delay. A trader watching for a breakout out of a tight range sees that confirmation sooner on DEMA than on an EMA plotted at the same period.

  • Faster in fast moves: That speed shows up most in a fast move, where DEMA confirms a change well before an EMA does, which matters most on a stock that gaps or spikes rather than trending steadily.

  • Simple to use: DEMA also needs only one input, the period, so it is simple to add to a chart and simple to explain to someone reading it for the first time.

These are read speed advantages. DEMA does not improve the odds of a trade working out, it only shortens how long a trader waits to see a trend confirmed.

Limitations of Using DEMA

DEMA carries three limitations that sit opposite its advantages.

  • More false signals when ranging: DEMA throws off more false signals once the market stops trending and starts ranging, since the same speed that catches a real move early also catches noise early.

  • Still a lagging indicator: It is still a lagging indicator, confirming a move that has already started rather than leading one, so a trader using DEMA alone is always reacting a step behind price.

  • Tempts overtrading: Its speed also tempts overtrading. A line that reacts this fast produces crosses often enough that a trader can end up acting on every wobble rather than waiting for a real trend.

When DEMA Gives False Signals

Take a two week stretch where price moves sideways between a defined high and low, with no real trend either way. A 20 and 50 period DEMA crosses back and forth six times over that stretch as price drifts across both lines. Every one of those six crosses is false. A trader acting on each would pay the spread six times over and get stopped out on most of them, since price never commits to either side.

Before acting on any DEMA cross, check two things. First, what the trend looks like on a higher timeframe, since a cross against the higher timeframe trend is more likely to be one of these false ones. Second, look for one confirmation that is not itself a moving average, such as volume or a momentum reading, rather than trusting the cross alone.

Look at the same sideways stretch using only a 50 period DEMA and the picture changes. A single slower line barely reacts to the chop, so it produces far fewer crosses, but the ones it does give arrive later. That is the trade off in plain terms, fewer false signals against a slower confirmation.

How to Add the DEMA Indicator to MetaTrader 4 and MetaTrader 5

DEMA is built into MetaTrader 5 but is not included in MetaTrader 4’s standard indicator library. TMGM traders can therefore add DEMA directly to an MT5 chart, while MT4 users must first install a compatible custom indicator. The following instructions apply to the desktop versions of both platforms.

   
PlatformDEMA availabilityInstallation method
MetaTrader 5Built-in indicatorSelect DEMA from the Trend indicators
MetaTrader 4Custom indicator requiredInstall an MQ4 or EX4 indicator file

How to Add DEMA to MetaTrader 5

MetaTrader 5 lists DEMA as a built-in trend indicator, so no additional file or plugin is required.

  1. Open the TMGM MetaTrader 5 platform and select the chart you want to analyse.

  2. Choose Insert from the main menu.

  3. Select Indicators, followed by Trend.

  4. Choose Double Exponential Moving Average.

  5. Enter the required DEMA period in the settings window. For example 20 period

  6. Select the price data to which DEMA should be applied. Closing price is the conventional choice, although MT5 also supports open, high, low, median, typical and weighted close prices.

  7. Choose the line colour, style and thickness.

  8. Select OK to add DEMA directly to the price chart.

The period controls how quickly the DEMA reacts to price changes. A shorter period follows recent prices more closely but produces more fluctuations, while a longer period creates a smoother line that reacts more slowly. The period represents chart bars rather than a fixed amount of time. For example, a 20-period DEMA uses 20 five-minute bars on a five-minute chart and 20 daily bars on a daily chart.

How to Install DEMA on MetaTrader 4

MetaTrader 4 does not include DEMA among its standard technical indicators. A compatible DEMA file must be installed before the indicator can be added to a TMGM MT4 chart.

  • Obtain a DEMA indicator in MQ4 or EX4 format from a trusted source.

  • Open the TMGM MetaTrader 4 desktop platform.

  • Select File, followed by Open Data Folder.

  • Open the MQL4 folder and then the Indicators folder.

  • Place the DEMA indicator file inside the Indicators folder.

  • Return to MT4 and restart the platform. Alternatively, open the Navigator, right-click Indicators and select Refresh.

  • Expand Indicators or Custom Indicators in the Navigator.

  • Double-click the installed DEMA indicator or drag it onto the required chart.

  • Configure its period, price source and appearance, and then select OK.

The parameter names can differ between custom DEMA indicators because each file may be coded differently. Confirm that the indicator follows the standard formula:

DEMA = 2 × EMA₁ − EMA₂

In this formula, EMA₁ is the exponential moving average of price and EMA₂ is the exponential moving average of EMA₁. An indicator described as a “double EMA crossover” may plot two ordinary EMAs instead of calculating DEMA, so the name and formula should be checked before use.

Only install custom indicators from sources you trust. A basic DEMA calculation does not normally require external web access or DLL imports. Do not enable additional permissions unless the indicator documentation explains why they are necessary.

How to Add Two DEMAs for Crossover Analysis

A fast-and-slow DEMA setup requires two separate instances of the indicator. Add DEMA to the chart once with the shorter period, and then repeat the process with the longer period. Give each line a different colour so the two averages remain distinguishable.

For example, a trader could use a 20-period DEMA as the faster line and a 50-period DEMA as the slower line. A move by the 20-period DEMA above the 50-period DEMA indicates that shorter-term prices are strengthening relative to the longer-term average. A move below it indicates weakening short-term price direction.
These periods are examples rather than universal settings. The appropriate combination depends on the instrument, chart timeframe, volatility and trading objective. Test the settings on historical data or a TMGM demo account before using the signals in live trading, because a faster DEMA can produce frequent crossovers during sideways markets.

Frequently Asked Questions

Is DEMA a Leading or Lagging Indicator?

DEMA is a lagging indicator as it confirms a trend after price has already moved, the same as every other moving average. Its only real difference from an EMA is how much less lagging it is, not a change in kind. It does not predict where price goes next, it responds to where price has already gone.

What Is the Difference Between DEMA and TEMA?

The Triple Exponential Moving Average (TEMA), runs the same smoothing process a third time, which makes it react even faster than DEMA and pick up more short term noise along the way. DEMA suits a trader who wants a faster read than EMA without going as far as TEMA, which suits a trader chasing the fastest possible signal on the shortest timeframes.

Is a Double Moving Average the Same as DEMA?

No. A double moving average usually means two separate moving average lines plotted on the same chart, such as a 20 period and a 50 period line used together for crossovers. DEMA is different, it is a single line built by running one EMA twice over the same period and combining the two results.

Which Indicators Pair Well With DEMA?

DEMA pairs well with tools that measure something other than price direction. A momentum indicator such as the RSI shows whether a move has strength behind it. A volume indicator shows whether real participation backs a crossover. Pairing tools like this does not guarantee better odds, it gives a trader a second, independent reason to trust a signal DEMA has already given.

Does DEMA Work on Intraday Timeframes?

Yes. DEMA works on intraday charts the same way it works on daily ones. A faster line on a lower timeframe picks up more noise, not less, so the confirmation step matters more on an intraday chart than it does on a daily one, not less.

Is DEMA Suitable for Beginners?

The formula looks complicated on paper, but no trader calculates it by hand, the platform does it the moment DEMA is added to a chart. The harder part for a beginner is reading a fast line without overtrading it, which takes practice regardless of how the indicator is built.

A group of expert analyst with strengths in fundamental and technical analysis, and years of experience in the Global Equity Markets, Forex, Precious Metals, Oils and other commodities, as well as Crypto, and so on.
Rejoignez plus de 1 000 000 de clients sur notre plateforme de trading primée
1
Demander un Compte
Réel
2
Alimenter Votre
Compte
3
Commencer à Trader
Instantanément
Ouvrir un Compte