Appearance
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
| Input | Type | Default |
|---|---|---|
| ADX smoothing | int | 14 |
| DI length | int | 14 |
| Color | color | "#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" }) });