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.
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.
| Case | High: before → now | Low: before → now | Up move | Down move | Counts as |
|---|---|---|---|---|---|
| 1. Up move is larger | 100 → 104 | 94 → 93 | 4 | 1 | +DM = 4, −DM = 0 |
| 2. Down move is larger | 104 → 105 | 96 → 91 | 1 | 5 | +DM = 0, −DM = 5 |
| 3. Candle inside the one before | 106 → 105 | 96 → 98 | −1 | −2 | +DM = 0, −DM = 0 |
How do you read +DI and −DI?
#| What you see | What it suggests |
|---|---|
| +DI above −DI | Up moves have been larger than down moves over the last 14 candles. |
| −DI above +DI | Down moves have been larger than up moves over the last 14 candles. |
| +DI crosses above −DI | The balance of recent moves has shifted toward up moves. |
| −DI crosses above +DI | The balance of recent moves has shifted toward down moves. |
| Both lines close together | Up 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
- ADX indicator (Average Directional Index) explainedThe ADX indicator measures how strong a trend is, from 0 to 100, not which way it points. See how it is calculated, how to read it, and how to test rules.
- Aroon indicator explained: how to read Aroon Up and DownAroon Up and Down count how recently price made its highest high and lowest low. See how they are calculated, how to read them, and how to test rules.