← Script Marketplace
Open-source scriptindicator/v1

Double Exponential Moving Average

by Kodexius·@kodexius·

Reduce conventional exponential-average lag by combining one and two stages of EMA smoothing.

#dema#moving-average#trend
Double Exponential Moving Average chart preview

Description

The Double Exponential Moving Average combines a standard EMA with an EMA of that EMA. Its lag-reduction formula creates a line that reacts faster than a conventional exponential average while retaining meaningful smoothing.

Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.

Release notes

Version history · 1 published version

Version 1CurrentChart updatedDouble Exponential Moving Average · Aug 31, 2026
Release notes

Initial classic indicator release.

View current source ↓
Source codempl-2.0View source

indicator("Double Exponential Moving Average", { overlay: true });
const length = input.int("Length", 9, { min: 1, max: 500 });
const source = input.source("Source", "close");
const first = ema(source, length);
const second = ema(first, length);
const line = first.map((v, i) => 2 * v - second[i]);
plot(line, { title: "DEMA", color: "#2962ff", lineWidth: 2 });
  

Community discussion

0 comments

Loading…

No comments yet. Start the discussion.