◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Indicators / ADX / DMI (Average Directional Index / Directional Movement)
Trend indicator

ADX / DMI (Average Directional Index / Directional Movement)

A trend-strength gauge with two directional lines, built to measure how strong a move is rather than which way it goes.

Illustrative diagram — not live market data.

What it is

ADX/DMI is a single indicator family developed by J. Welles Wilder. It has three lines: +DI (positive directional indicator) and -DI (negative directional indicator), which together form the DMI, plus the ADX line, which is derived from them. The DI lines describe the direction of price movement, while ADX measures the strength of the trend regardless of direction. The most common lookback is 14 periods. ADX is plotted on a 0-100 scale (in practice it rarely climbs very high). It is educational and descriptive only, not a buy or sell signal, and like every indicator it is not predictive.

How it works

Wilder first measures "directional movement" each bar by comparing today's high and low to the previous bar's high and low. If price extends further up than down, that bar contributes to +DM; if it extends further down than up, it contributes to -DM. These raw values are smoothed over the lookback period and divided by the Average True Range (ATR) to produce +DI and -DI as normalized percentages, so they can be compared across instruments. ADX is then built from the gap between the DI lines: each bar's DX equals the absolute difference between +DI and -DI divided by their sum (times 100), so DX measures how lopsided the two lines are. ADX is the smoothed average of DX over the lookback. A large, persistent gap between +DI and -DI keeps DX and therefore ADX high (a strong trend), while DI lines that stay close together keep ADX low (a weak or sideways market). Crucially, ADX rises whether the trend is up or down, because it reflects the size of the gap, not its sign.

How traders read it

Common settings

Default lookback is 14 periods for both the DI calculation and the ADX smoothing, as in Wilder's original work. Some traders shorten it (e.g. 7-10) for faster, noisier readings or lengthen it (e.g. 20-30) for smoother, slower ones. The 20 and 25 levels are the most cited reference thresholds, but they are conventions you can adjust per market and timeframe.

Strengths

Pitfalls to watch

Pine v6 example

//@version=6
indicator("ADX / DMI", overlay = false)

length = input.int(14, "DI Length", minval = 1)
adxLength = input.int(14, "ADX Smoothing", minval = 1)

[diPlus, diMinus, adx] = ta.dmi(length, adxLength)

plot(diPlus, "+DI", color = color.teal)
plot(diMinus, "-DI", color = color.red)
plot(adx, "ADX", color = color.orange, linewidth = 2)
hline(25, "Reference level", color = color.gray, linestyle = hline.style_dashed)

Pro tip: Read ADX and the DI lines together rather than in isolation: ADX describes whether a trend is strong enough to be worth watching, while the +DI/-DI relationship describes which side currently dominates. A rising ADX with a clear DI separation is the situation many traders find most informative, but this is interpretation for study, not a signal to act on, and no indicator can predict what price does next.

Built an indicator from this? Run it through the Validator to catch look-ahead bias and repainting, or convert a strategy to Pine Script.

Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro