What is DMI?
The Directional Movement Index draws three lines in one pane. +DI measures how much of the recent range came from bars pushing above the previous high, and -DI how much came from bars pushing below the previous low, both as a percentage of the average true range. ADX, the third line, measures how far apart +DI and -DI have been, which describes the strength of the trend in either direction.
+DI above -DI means upward movement has dominated, and the reverse for downward. ADX on its own says nothing about direction: a high ADX can mean a strong uptrend or a strong downtrend. None of the lines predicts where price goes next.
How to use DMI
- Which DI is on top. +DI above -DI means upward pushes beyond the previous high have outweighed downward pushes beyond the previous low over the smoothing period.
- DI crosses. +DI crossing above -DI is the usual sign of a turn towards up, and the reverse for down. In a range the two cross often without follow-through.
- ADX rising or falling. A rising ADX means the gap between the DI lines is widening, so one direction is gaining control. A falling ADX means the trend is losing strength or price is ranging.
- Reading them together. A DI cross while ADX is low and falling carries less weight than one while ADX is rising.
These are ways to read the lines, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| ADX Smoothing | 14 | Bars in the Wilder average that turns the DI gap into ADX. Lower makes ADX react sooner; higher makes it smoother and slower. Minimum 1. |
| DI Length | 14 | Bars in the Wilder averages behind +DI and -DI, including the average true range they are divided by. Lower makes the DI lines faster and noisier. Minimum 1. |
Adjust both lengths in the indicator settings.
Calculation
Each bar's directional movement is measured against the previous bar, smoothed with Wilder's moving average and divided by the smoothed true range:
up = high - previous high
down = previous low - low
+DM = up if up > down and up > 0, else 0
-DM = down if down > up and down > 0, else 0
TR = max(high - low, |high - previous close|, |low - previous close|)
+DI = 100 * RMA(+DM, 14) / RMA(TR, 14)
-DI = 100 * RMA(-DM, 14) / RMA(TR, 14)
DX = |+DI - -DI| / (+DI + -DI)
ADX = 100 * RMA(DX, 14)
RMA is Wilder's moving average, an exponential average with a smoothing factor of 1 / length, so a length of 14 moves each value one fourteenth of the way towards the new input. It is slower than a standard exponential average of the same length.
The first bar has no previous bar, so it has no directional movement and no true range. The DI lines therefore start on the fifteenth bar of loaded history and ADX, which needs 14 values of DX, about 13 bars after that. If a DI value cannot be calculated on a bar, the previous value is carried forward. When +DI and -DI are both zero, DX is taken as zero rather than dividing by zero.
The arithmetic is identical to the Average Directional Index built-in, so the ADX line here matches that indicator exactly. No reference levels are drawn.
Limitations
- It lags. Three layers of Wilder smoothing mean ADX in particular confirms a trend well after it has started and keeps rising after the move has slowed.
- DI crosses whipsaw in ranges. When price moves sideways, +DI and -DI sit close together and cross repeatedly.
- ADX has no direction. A high ADX in a sell-off looks the same as a high ADX in a rally. Read it with the DI lines.
- Early values depend on history. Wilder smoothing settles slowly, so values near the start of the loaded history differ from what longer history would show.
- The live candle moves. The current bar's high, low and close change until it closes, so the latest values and any cross can change.
Frequently asked questions
The Directional Movement Index is a set of three lines. +DI and -DI measure upward and downward movement beyond the previous bar's high and low, as a share of the average true range. ADX measures how far apart those two lines are, which describes trend strength without direction.
Use the DI lines for direction and ADX for strength. +DI above -DI with ADX rising describes a strengthening uptrend; -DI above +DI with ADX rising a strengthening downtrend. A low or falling ADX means neither side is in control, and DI crosses then deserve less weight.
Yes. The indicator declares two inputs: ADX Smoothing, default 14, and DI Length, default 14, each with a minimum of 1. DI Length sets the averages behind +DI and -DI; ADX Smoothing sets the average that produces ADX. Open the indicator's settings on the chart to change them.
They use exactly the same calculation. Directional Movement draws all three lines, +DI, -DI and ADX. Average Directional Index draws only the ADX line, for when you want trend strength without the directional lines.
No. Closed bars are not revised. The current bar's values move while that bar is live and settle when it closes. Loading older history recalculates the Wilder averages from an earlier start, so values near the very start of the loaded range can shift.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Directional Movement already applied. On any other market, open the indicator picker on the chart and choose Directional Movement from the Trend group.