Indicator Formula

Technical Details — Double Exponential Moving Average (DEMA)
Section titled “Technical Details — Double Exponential Moving Average (DEMA)”Overview
Section titled “Overview”The Double Exponential Moving Average (DEMA) reduces EMA lag by computing an EMA of the EMA, then using the formula 2×EMA - EMA(EMA). This cancels out much of the inherent lag in exponential smoothing.
Mathematical Derivation
Step 1 — Calculate First EMA
Section titled “Step 1 — Calculate First EMA”Purpose: Standard EMA of closing prices.
$$EMA_1[t] = EMA(Close, n)$$
Where:
- $$n$$ = Period
What This Measures: Standard exponentially smoothed price
Step 2 — Calculate EMA of EMA
Section titled “Step 2 — Calculate EMA of EMA”Purpose: Apply EMA again to smooth the first EMA.
$$EMA_2[t] = EMA(EMA_1, n)$$
What This Measures: Double-smoothed price (more lag but smoother)
Step 3 — Compute DEMA
Section titled “Step 3 — Compute DEMA”Purpose: Cancel out lag by doubling the first EMA and subtracting the second.
$$DEMA[t] = 2 \times EMA_1[t] - EMA_2[t]$$
What This Measures: Lag-reduced exponential average
Compact Formula Summary
$$DEMA[t] = 2 \times EMA(Close, n) - EMA(EMA(Close, n), n)$$
Default Parameter: Period (n) = 14
Complete Calculation Example
If EMA₁ = 44.59 and EMA₂ = 44.45:
$$DEMA = 2 \times 44.59 - 44.45 = 89.18 - 44.45 = 44.73$$
DEMA is closer to current price than either EMA — the doubling trick cancels lag.
Key Takeaways from the Example
- Lag Reduction: DEMA’s formula cancels much of the lag inherent in single EMA
- More Responsive: Reacts to price changes faster than EMA but slower than HMA
- Same Period: Uses the same period for both EMA calculations — only one parameter needed
- Can Overshoot: Like HMA, DEMA can temporarily lead price during strong moves