DMI (ADX / DI)
How strong the trend is, and whether buyers or sellers are pushing harder.
Wilder's directional movement, from the second candle: +DM = up move when it beats the down move and is > 0, else 0 (−DM mirrored); true range, +DM and −DM are Wilder-smoothed (RMA, SMA-seeded). ±DI = 100 × smoothed DM ÷ smoothed TR; DX = 100 × |+DI − −DI| ÷ (+DI + −DI); ADX = RMA(DX, period). Not ready while the smoothed TR or the DI sum is 0. Mirror: +DI and −DI swap (the comparison keeps its direction); ADX is unchanged.
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| period | 14 | 1 to 500 | Wilder smoothing period. |
What it gives
| Output | What it is |
|---|---|
| ADX | Trend strength, 0–100. |
| +DI | +DI, 0–100. |
| −DI | −DI, 0–100. |
What it reads
It reads the whole candle (open, high, low, close and volume).
Warm-up
With its default settings, DMI (ADX / DI) needs 282 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses DMI (ADX / DI) with its default settings