Part of the Indicator Math series. This one separates two questions that look like one on a chart: which way is price leaning, and how consistently is it leaning that way?

A rising ADX can go with falling prices

Imagine the S&P futures chart is making lower lows, but the ADX line underneath it is rising. The indicator isn’t disagreeing with the chart. It is picking up a growing imbalance between downward and upward moves. In this case, the downside is doing most of the work.

Read the three lines in the right order. The plus and minus directional indicators, +DI and −DI, tell you which side has produced more directional movement after smoothing. The Average Directional Index, or ADX, tells you how lopsided that balance has been lately. TradingView groups all three under Directional Movement, or DMI. Reading the ADX line alone is like looking at a speedometer to find out which way the car is headed.

The ADX and DMI formula

J. Welles Wilder Jr. presented the Directional Movement System in his 1978 book New Concepts in Technical Trading Systems. StockCharts’ walkthrough of Wilder’s method uses his recommended 14 periods for both the directional calculations and the ADX smoothing. TradingView’s DMI display shows those as two settings, 14 and 14. On a five-minute chart, that means periods of five minutes, not trading days.

Pick a side for each bar

Compare the current bar’s high and low with the prior bar’s. A higher high gives you a positive up move; a lower low gives you a positive down move. Credit only the larger positive move as directional movement, or DM. The chart’s −DM label refers to the down side, but you store its size as a positive number. On an inside bar, where neither edge extends, both sides get zero. If both edges extend by the same amount, neither wins and both get zero again.

Up move = current high − prior high
Down move = prior low − current low
+DM = up move if up move > max(down move, 0)
−DM = down move if down move > max(up move, 0)
Otherwise that side’s DM is 0

Measure true range, or TR, separately. It’s the largest of the bar’s high minus low, the distance from its high to the prior close, or the distance from its low to the prior close. Those last two distances ignore sign. This is where the prior close enters the directional line calculation, and why an overnight gap can matter even when the current bar itself is narrow.

Smooth the inputs, then smooth the imbalance

Let N be the directional period count. Keep three smoothed totals, one for +DM, one for −DM, and one for TR. Start each at the sum of its first N observations. From then on, drop one Nth of the prior total and add the new observation. Divide each smoothed DM by the same smoothed TR and multiply by 100. If smoothed TR is zero, treat both directional lines as zero for this calculation.

New total = prior total − (prior total ÷ N) + new input
+DI = 100 × smoothed +DM ÷ smoothed TR
−DI = 100 × smoothed −DM ÷ smoothed TR
DX = 100 × |+DI − (−DI)| ÷ (+DI + (−DI))

For each input, its smoothed total divided by N is its Wilder-smoothed average. You can use either totals or averages in the DI ratios: dividing the numerator and denominator by the same N leaves the answer unchanged.

DX, or Directional Index, is the absolute gap between the lines divided by their sum. The vertical bars mean take the size of the gap, without its sign. Use zero for DX when both directional lines are zero in this version. To turn DX into ADX, let M be the ADX smoothing length. The first ADX is the average of the first M valid DX values. After that, apply the same kind of Wilder smoothing you saw in RSI. Each new DX gets a weight of one divided by M.

First ADX = average of the first M DX values
New ADX = ((M − 1) × prior ADX + current DX) ÷ M

Work through eight bars by hand

Use a fictional stock and set both lengths to three so you don’t need a month of daily prices. Bar 1 supplies the prices for the first comparison on bar 2. Omit bar 1’s TR here so all three totals start together, unlike the standalone ATR example. The last column lists the unsmoothed true range, and the paired DM values are in plus, minus order.

BarHighLowClose+DM / −DMTR
110199100n/an/a
21031001022 / 03
310498990 / 26
41061001052 / 07
51051011040 / 04
610397980 / 47
710095960 / 25
89893940 / 25

Bar 3 extends both edges. Its high rises by one, but its low drops by two, so only −DM gets credit. On bar 4 the high-low range is six, but the prior close was 99 and the new high is 106. True range is seven because it captures that extra point. Bars 2 through 4 seed the three smoothed totals at 4, 2, and 16. That gives +DI of 25 and −DI of 12.50. The gap is 12.50 out of a combined 37.50, so DX is 33.33.

On bar 5, update smoothed +DM from 4 to 4 minus 4 divided by 3, plus zero, or about 2.67. Do the same on the minus side and add four to the decayed true-range total. The directional levels shrink but their ratio doesn’t change, so DX stays at 33.33.

On bar 6, the +DM, −DM, and TR totals update to about 1.78, 4.89, and 16.78. The lead flips to −DI, and DX of 46.67 is the third valid DX. Now you can seed ADX. Add the first three DX values, 33.33, 33.33, and 46.67, and divide by three for about 37.78. The next bar uses two parts prior ADX and one part new DX, giving 46.26.

Bar+DI−DIDXADX
425.0012.5033.33n/a
518.189.0933.33n/a
610.6029.1446.6737.78
77.3232.4963.2246.26
85.0034.8774.9055.81

Round for display only. If you round the three smoothed totals before feeding them into the next row, your spreadsheet will slowly drift from this table. The blank early ADX cells aren’t zeros. You just don’t have enough observations to seed the line yet.

What ADX actually measures

The chart below shows daily SPY prices and the 14-period DMI lines from January 2 to June 30, 2026. From March 2 to March 30, ADX rises from 14.7 to 41.2 as price falls, with −DI in the lead.

SPY daily candles with ADX, +DI and −DI below; ADX climbs through the March decline while the red −DI line leads.
SPY daily, Jan 2–Jun 30, 2026, with ADX and DMI (14): during March ADX rose from 14.7 to 41.2 while −DI led, a strong trend that was down.

Reading the lines gets easier once you notice what the DX formula throws away. Swap +DI and −DI and the size of the gap is unchanged. Double both at once and the ratio is unchanged, too. In fact, the two DI lines have the same true-range denominator, which cancels out of DX when it’s defined. ADX is a 0-to-100 average of relative directional imbalance, not a measure of raw distance traveled. It doesn’t tell you how wide to place a stop, how fast price is moving in dollars, or whether the next bar will follow through.

A falling ADX only means the smoothed imbalance is easing. In an uptrend that can happen while price is still grinding to new highs. Ask whether the directional lines have actually switched and whether price has broken the structure that supports your trade. Neither is implied by ADX turning down.

How traders use it

  • Trend filter for pullbacks: Test long pullback-to-value entries only when +DI leads and ADX is above a threshold such as 25. The filter gives you permission to look. A separate price rule has to show the pullback is ending before you take the trade.
  • Choose a range playbook: If ADX is below 20 and price has repeatedly held two clear range boundaries, test a trade from one edge toward the middle. If price closes beyond the range, the price condition is gone even if ADX still looks low. Wilder’s 20 and 25 levels are starting points, not universal cutoffs.
  • ES breakout qualification: On a five-minute regular-session ES chart, map the opening range first. For a short, test requiring a close below the range, −DI above +DI, and ADX higher than on the previous closed bar. Keep the session template fixed so yesterday’s and today’s readings use the same bar rules.
  • Exit review, not an automatic exit: In a short, a weakening ADX can put you on alert. Test tightening a trailing stop only after price also closes above a prior swing high, and compare that version with a price-only exit. A drop in ADX alone is not a reason to move your stop farther away or add risk.

Where it fails

ADX is late by design. DM and TR are smoothed before DX is calculated, then DX is smoothed again. A market can reverse before ADX drops, and ADX can stay high if the new move is strong enough to replace the old one. In two-way chop, the directional lines can cross back and forth without delivering an actionable trend. More sensitive settings may catch a turn earlier, but they also react more to short bursts. On the other side, a longer length can rule out the early part of the move your strategy needs.

Chart setup can change what you see. Switching between overnight and regular-session data changes the bars, and loading a different amount of history can change the early smoothed values. A live bar can update its high, low, and close, so a crossover you see mid-bar may be gone by the finish. That’s not the same as rewriting a closed signal. If your rules require a close, record the end-of-bar values in your test and in live review.

Takeaway: Use +DI and −DI to read which side has produced more directional movement. Use ADX to judge how one-sided that movement has been. Let price provide the entry or exit rule, and test whether adding the filter improves the decisions you actually make.

Next up: OBV and Money Flow: What Volume Indicators Actually Count

Leave a Reply