Skip to content

Double EMA ​

Double EMA: 2 x EMA minus EMA of EMA, less lag.

Kind indicator · Drawn on the price pane

Try it ​

On the chart, press / and choose Double EMA under Moving averages. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
Lengthint9
Sourcesource"close"
Colorcolor"#43A047"

Source ​

From packages/alphascript/indicators/dema.as.js.

js
indicator({ name: "Double EMA", shortTitle: "DEMA", overlay: true });
const length = input.int("Length", 9, { min: 1 });
const src = input.source("Source", "close");
const e1 = ta.ema(src, length), e2 = ta.ema(e1, length);
plot(ta.calc([e1, e2], (a, b) => 2 * a - b), { title: "DEMA", color: input.color("Color", "#43A047", { group: "Style" }) });

AlphaScript language v0.1 · runtime 0.2.0