Charts See the terminal

Double Exponential Moving Average (DEMA)

An EMA with an estimate of its own lag added back, so it turns sooner than an EMA of the same length, at the cost of overshooting at turns.

Moving Average Add to chart

Live DEMA preview · BTC/USDT · Binance

What is DEMA?

The double exponential moving average draws one line through price that follows it more closely than an ordinary EMA of the same length. It does this by measuring how far the EMA is trailing price and adding that distance back. The result turns sooner after a change in direction.

Despite the name, DEMA is not an EMA applied twice, which would be slower, not faster. It does not confirm trend strength or predict future prices, and the lag correction makes it overshoot price at sharp turns.

How to use DEMA

  • Price above or below the line. Price holding above DEMA is read as context for an uptrend, below it for a downtrend. Because the line hugs price, it is crossed more often than an EMA.
  • The slope. DEMA changes direction sooner than an EMA, so a change in its slope is an earlier, and less filtered, sign that the move is stalling.
  • DEMA against an EMA of the same length. The gap between the two shows how much lag correction is being applied. It widens in strong moves and closes when price goes flat.
  • Period length. Shorter reacts sooner and overshoots more; longer is smoother and later.

These are ways to read the line, not entry signals on their own.

Settings

SettingDefaultWhat it changes
Length9 Bars used by both EMAs inside the calculation. Lower turns sooner and whipsaws more; higher is smoother and later. Minimum 1.
SourceClose Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available.

Adjust the period and price source in the indicator settings.

Calculation

DEMA takes an EMA of price, then an EMA of that EMA. The second line measures how far the first is trailing, and the difference is added back:

alpha = 2 / (length + 1)          (0.2 at the default 9)
e1    = EMA(price, 9)
e2    = EMA(e1, 9)
DEMA  = 2 * e1 - e2

In a steady trend e1 trails price by roughly the same amount that e2 trails e1. Doubling e1 and subtracting e2 cancels most of that lag. When price reverses sharply, the correction is still pointing the old way for a few bars, which is why DEMA runs past price before turning.

Each EMA is seeded from the simple average of its first n values. The second EMA needs nine values of the first, so with the default length the line first appears on bar 17, later than a plain EMA of the same length.

Limitations

  • It overshoots. The lag correction pushes the line past price at sharp turns. Less lag is paid for with more noise.
  • Sideways markets produce frequent crossings. Because the line follows price closely, choppy conditions generate more crossings than an EMA would.
  • It takes longer to start. Two chained averages need about twice the length in bars before the first value appears.
  • It depends on timeframe, period and source. The same indicator gives a different line on 15m than on 1D, or on close against hl2.
  • It is not a strategy. On its own it carries no risk management, sizing or exit.

Frequently asked questions

DEMA is a lag-reduced moving average. It computes an EMA of price, then an EMA of that EMA, and plots twice the first minus the second. The result follows price more closely than an EMA of the same length.

No. An EMA of an EMA is smoother and slower than either. DEMA uses that slower line only to measure the lag, then adds the lag back to the first EMA. That is why it is faster, not slower.

[TEMA](/library/indicator/tema) applies the same correction one step further, using three chained EMAs. It turns sooner than DEMA and overshoots more.

Yes. The indicator has two inputs: Length, default 9 with a minimum of 1, and Source, default close. Open the indicator's settings on the chart to change them. Source accepts open, high, low, close and the averaged sources such as hl2 and hlc3.

Values on closed bars are not revised. The current candle's value moves while that candle is live and settles when it closes. Like any exponential average it needs a starting point, so loading older history recalculates it and values near the very start of the loaded range can shift.

Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Double EMA already applied. On any other market, open the indicator picker on the chart and choose Double EMA from the Moving Average group.

Add to chart