DMI (Directional Movement Index) explained: +DI and −DI

By Oalgo · Last reviewed

The Directional Movement Index (DMI) compares recent up moves in price with recent down moves, as two lines: +DI for up moves and −DI for down moves. The higher line shows which direction has been stronger. The usual setting is 14 candles.

Diagram: three pairs of example candles, each pair showing the candle before and the candle now. In the first pair the high rises more than the low falls, so the up move counts as +DM. In the second the low falls more than the high rises, so the down move counts as −DM. In the third the candle now sits inside the candle before, so neither counts.Candle beforeCandle nowUp moveDown move+DMUp moveDown move−DMUp moveDown moveNeither counts
Example prices, made up for this page. The numbers are in the table below.

How is DMI calculated?

#
  • Up move = this candle's high − the previous candle's high. Down move = the previous candle's low − this candle's low.
  • +DM = the up move, if it is larger than the down move and above 0. Otherwise 0. −DM = the down move, if it is larger than the up move and above 0. Otherwise 0.
  • True range: the largest of three distances. High to low. High to the previous close. Low to the previous close. It is the same one ATR uses.
  • Smooth +DM, −DM and the true range with Wilder's method over 14 candles.
  • +DI = 100 × smoothed +DM ÷ smoothed true range. −DI = 100 × smoothed −DM ÷ smoothed true range.

Which move counts as +DM or −DM?

#

Only one of the two moves counts on each candle, and only if it is above 0. The three cases below are the three pictures in the diagram.

CaseHigh: before → nowLow: before → nowUp moveDown moveCounts as
1. Up move is larger100 → 10494 → 9341+DM = 4, −DM = 0
2. Down move is larger104 → 10596 → 9115+DM = 0, −DM = 5
3. Candle inside the one before106 → 10596 → 98−1−2+DM = 0, −DM = 0

How do you read +DI and −DI?

#
What you seeWhat it suggests
+DI above −DIUp moves have been larger than down moves over the last 14 candles.
−DI above +DIDown moves have been larger than up moves over the last 14 candles.
+DI crosses above −DIThe balance of recent moves has shifted toward up moves.
−DI crosses above +DIThe balance of recent moves has shifted toward down moves.
Both lines close togetherUp and down moves have been about equal.

Each line is a share of the true range, so both can be low when price barely moves.

How do people use DMI in rules?

#
  • +DI crossing above or below −DI.
  • +DI above −DI as a direction filter, together with ADX above a level so the trend is strong enough.
  • The gap between the two lines above a size you choose, so that small differences are ignored.
  • A different period. A shorter one reacts faster and crosses more often.

What can DMI not tell you?

#

DMI is built mostly from highs and lows, so a gap or one extreme candle can move it. It shows which direction has been larger, not that it will continue, and in a sideways market the two lines cross again and again. Test any rule on past prices with a backtest, then forward test it.

In Oalgo you can tell Oalgo AI your DMI rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.

Read next