ADX (Average Directional Index)

ADX measures a trend's strength, whatever its direction, from 0 to 100, helping you tell trending markets from ranges.

What it is

ADX was also introduced by Welles Wilder. It is built from two directional lines, +DI and −DI, that measure the strength of up and down moves. ADX itself has no direction; it only says how strong the current trend is, whichever way it points.

How it's calculated

  1. Each candle's positive and negative directional movement comes from comparing its high and low with the previous candle's.
  2. +DI and −DI = smoothed averages of those moves divided by ATR
  3. DX = 100 × |+DI − −DI| ÷ (+DI + −DI), and ADX is the smoothed average of DX over 14 candles.

How traders read it

  • ADX below 20 usually means no trend; above 25 a meaningful one.
  • A rising ADX means the trend is strengthening, up or down.
  • +DI and −DI crossing shows the trend's direction.

Settings

The default length is 14. Use ADX mostly to choose a strategy type: trend-following when ADX is high, range trading when it is low.

Where it misleads

  • ADX falling from a high level doesn't necessarily mean a reversal; the trend may just be slowing.
  • ADX is slow and shows trend changes late.

Its Pine Script on Vlevel

This is the script the chart runs. In the chart's indicators window you can open it, change it and save your own copy.

Average Directional Index · Pine Script v6
//@version=6
indicator("Average Directional Index", shorttitle = "ADX")
adxlen = input.int(14, "ADX Smoothing", minval = 1)
dilen  = input.int(14, "DI Length", minval = 1)
[diplus, diminus, adx] = ta.dmi(dilen, adxlen)
plot(adx, "ADX", color = #f5c542)
hline(25, "Trend", color = color.new(color.white, 75), linestyle = hline.style_dashed)

Indicators describe past prices; none predicts the future. For education, not investment advice.