Skip to content

Average Directional Index ​

Trend strength (Wilder), 0 to 100.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Average Directional Index under Trend. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
ADX smoothingint14
DI lengthint14
Colorcolor"#FF5252"

Source ​

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

js
indicator({ name: "Average Directional Index", shortTitle: "ADX", overlay: false, precision: 2 });
const smoothing = input.int("ADX smoothing", 14, { min: 1 }), diLength = input.int("DI length", 14, { min: 1 });
plot(ta.adx(diLength, smoothing), { title: "ADX", color: input.color("Color", "#FF5252", { group: "Style" }) });

AlphaScript language v0.1 · runtime 0.2.0