GUIDE

ADX explained, and how to write it as a condition

Momentum · 5 min read

The Average Directional Index is the one common indicator that says nothing about which way price is going. It measures how strongly it is going, which is a different question and a useful one to put next to any condition that fires on a turn.

ADX with its +DI and −DI lines drawn under a price chart; the ADX line rises through 25 as a trend develops, and that bar is highlighted
Illustrative candles. The ADX line rises as the move gets going; +DI and −DI say which side has been winning.

What it measures

Each bar, the indicator asks how much higher the high got than the bar before (upward movement) and how much lower the low got (downward movement), keeps whichever is larger, and averages both over the last N bars — fourteen by default. Those two averages, scaled by the average range, are the +DI and −DI lines: how much of the recent movement has been up, and how much down.

The ADX line is built from the gap between them. When one side dominates — nearly all the movement up, or nearly all down — the gap is wide and ADX is high. When the two are roughly equal, price is going nowhere in particular and ADX is low. It is on a 0 to 100 scale, and it is the same number whether the dominant side is up or down: a reading of 40 in a steady fall is the same 40 as in a steady rise. The conventional reading is that a trend is in force above about 25 and absent below about 20. Those are labels for regions of the scale, not forecasts.

The two settings

  1. Period. How many bars the directional movement is averaged over. Fourteen is the default. ADX is smoothed twice, so it reacts more slowly than most indicators of the same length: a strong move takes several bars to lift the line, and it stays up for a while after the move has stalled.
  2. Threshold. The level the "greater than" and "less than" conditions compare ADX against. Twenty-five is the default. The DI conditions do not use it.

Writing it as a condition

These are the comparisons SixOne8 offers, in the builder's own words. The first four read the ADX line; the rest read the two DI lines.

  1. Greater than / less than the threshold. True for every bar ADX is on that side of it. A state: "a trend is in force", or "no trend is in force".
  2. Rising / falling. ADX is higher, or lower, than the bar before — the trend is getting stronger, or fading. Note that a rising ADX during a fall means the fall is strengthening.
  3. +DI above −DI / +DI below −DI. Which side has dominated the period. A state, and the only way this indicator expresses a direction.
  4. +DI crosses above / below −DI. The moment the dominant side changes. True only on that bar.

ADX(14) on 4h  ·  greater than  ·  25

Read it as a sentence: on the 4-hour chart, the fourteen-period ADX is above 25. As a condition it is rarely the trigger. It is the gate: a strategy whose other conditions pick a moment will only be satisfied while this one says the market is trending.

What it is for

Most momentum conditions — RSI crossing 30, the Stochastic turning up, a MACD crossing — fire in quiet, directionless markets exactly as readily as in moving ones, and the quiet ones are where they match most often and mean least. Putting ADX greater than 25 on a slower timeframe beside such a trigger is the usual way to say "only when something is going on". The reverse is just as common: ADX less than 20 as the context for a condition that looks for a range, like a Bollinger Band touch.

Because ADX lags, it confirms a trend rather than catching its start. A condition that waits for ADX to cross 25 will be later than one that reads +DI crossing above −DI, which is the earliest thing this indicator can say — and the noisiest.

Before you trust it

Run an entry check on the whole strategy, gate included. It will tell you whether, on the market you care about, the moments it fired moved any differently from a random moment over the history tested. That is a fact about the past on that market, and it is the only kind of fact a test here produces.

Next