Measure DEMA's response to a one-bar price jump

Measure DEMA's response to a one-bar price jump

Give both filters a known starting level

Assume a long flat history at 100, followed by a close of 110. Use period 3, so the EMA weights the latest input by one half. Set the previous first and second EMA values to 100. A constant prehistory avoids arguments about seeding that would otherwise mask the comparison.

Compute the cascade

The first EMA moves halfway from 100 to 110 and reaches 105. The second EMA takes the first EMA as input and moves halfway from 100 to 105, reaching 102.5. If you simply plot this second value, you have added smoothing at the cost of a slower initial response.

DEMA = 2 × EMA₁ − EMA₂

Form the displayed DEMA

Double the first EMA and subtract the second. The result on the jump bar is 107.5. It lies closer to 110 than the first EMA does. If the following close remains 110, the next first EMA is 107.5 and the second is 105. DEMA reaches 110 on that second bar despite the unchanged close.

Inspect what follows the step

Hold price at 110 for one more bar. The two EMAs become 108.75 and 106.875; DEMA reaches 110.625. A line temporarily above every recent close is possible because of the subtraction. Check a step response before assuming that a moving-average output will always stay inside the observed price range.

Sources and further reading

Back to top

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.80

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping