How it is calculated
Twice the EMA of the source minus the EMA of that EMA, both with the same length. Each EMA is seeded with the simple average of its own first length inputs, so the second starts length minus 1 bars after the first and the first value needs 2 times length minus 1 bars, as TA-Lib's DEMA.
Reference: TA-Lib DEMA (Mulloy 1994)
How to read it
Read like an EMA, but it follows price more closely and turns sooner; the cost is more overshoot at turns and more false signals in a range. Despite the name it is not an EMA applied twice.
In a strategy
A quicker trend line, ctx.ind("dema", length=20), with a cross of the close over it as entry trigger and a slower average as filter.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 20 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| DEMA | Line |
Used in
No strategy template reads it yet.