How it works
The Directional Movement system splits a market’s behaviour into two questions and answers them with three lines. The two directional indicators, +DI and -DI, measure how much of the recent range was made by pushing above previous highs versus below previous lows. ADX, derived from the gap between them, discards direction entirely and reports only how one-sided that contest has been. It is the rare indicator that is explicitly agnostic about which way price is going.
The underlying measurement is directional movement. On each bar, the amount by which today’s high exceeds yesterday’s high is up-movement, and the amount by which today’s low falls below yesterday’s low is down-movement; only the larger of the two is recorded, and if neither is positive the bar records nothing. Those movements are smoothed and expressed as a percentage of true range, which normalises them so the resulting lines are comparable between a currency pair and a stock.
ADX itself is a smoothed average of how far apart +DI and -DI are. When one side dominates completely, the gap is wide and ADX climbs. When the two are interleaved, as they are in a range, the gap is small and ADX falls. Because ADX is smoothed twice — once in the DI calculation, once in the averaging of DX — it is slow, and it tells you about the character of the last few weeks rather than about today.
The practical use is almost always as a filter. Trend-following rules are switched on when ADX is above a threshold, conventionally 20 or 25, and switched off below it; mean-reversion rules do the reverse. Reading rising ADX as bullish is the standard beginner error — ADX rises just as happily in a collapse. Direction comes from the DI lines or from price itself, never from ADX.
Against its neighbours, ADX measures trend strength where Aroon measures trend freshness and Choppiness measures the same idea from the volatility side. The three often agree; when they disagree it is usually because ADX is still reporting the strength of a trend that Aroon already says has stopped making new extremes.
Calculation
The arithmetic in words, in the order it happens.
For each bar, up-movement is the current high minus the previous high and down-movement is the previous low minus the current low. Record +DM as the up-movement only if it is positive and larger than the down-movement, otherwise zero; record -DM by the mirror rule. Smooth +DM, -DM and true range over 14 periods using Wilder’s method. Then +DI is 100 times smoothed +DM divided by smoothed true range, and -DI is the same using -DM. DX is 100 times the absolute difference between +DI and -DI divided by their sum. ADX is Wilder’s smoothed average of DX, conventionally over 14 periods, so it takes roughly 28 bars before the first meaningful value appears.
Source
An AlgoBeamScript implementation of the formula above, written by us from the arithmetic so the code and the calculation agree line for line.
Runs unchanged on the platform and in the AlgoBeamTS runtime. The language reference is in the documentation.
Inputs
Defaults are the values most charting packages ship with. They are conventions, not optimal settings — the right length depends on your instrument and your holding period.
| Input | Default | What it changes |
|---|---|---|
| DI length | 14 | Lookback for the directional movement and true range smoothing. Shorter settings make the DI lines cross frequently and give a twitchier ADX; longer settings produce a stable regime read that is very late to fall after a trend ends. |
| ADX smoothing | 14 | The second smoothing applied to DX. Raising it flattens ADX into an almost editorial commentary on the last quarter; lowering it makes ADX react to individual strong weeks and lose its filtering value. |
How to read it
What practitioners take from the plot. Read these as descriptions of market state, not as entry signals.
- ADX below 20 and flat
- No trend worth following. Breakouts fail, moving-average crossovers whipsaw, and range or mean-reversion tactics have their best environment.
- ADX rising through 25
- A trend is establishing itself. Direction is not implied — check which DI line is on top before assuming anything about which way.
- ADX above 40 and turning down
- A strong trend that is losing its one-sidedness. Usually a consolidation or a pullback rather than a reversal, but it is the point at which trailing stops earn their keep.
- +DI crossing above -DI
- Upward directional movement has become dominant. Meaningful when ADX is rising; largely noise when ADX is below 20.
- DI lines converging while ADX falls
- The contest between buyers and sellers has evened out. The trend structure is dissolving even if price has not yet broken any level.
Limitations
Where this indicator misleads. None of these are fixed by a better parameter.
- Two layers of Wilder smoothing make ADX genuinely slow. It confirms a trend well after entry would have been attractive and stays elevated for weeks after one has ended.
- It says nothing about direction, and the number of traders who read a rising ADX as bullish is a permanent source of confusion. Direction must come from elsewhere.
- The 20 and 25 thresholds are conventions, not constants. Different instruments and different timeframes have visibly different ADX distributions, so a level that means trending on a daily equity chart can be routine on a five-minute crypto chart.
- Because directional movement compares highs and lows to the previous bar, a gap registers as a large directional move even if the session that follows goes nowhere.
Educational reference. This page explains how an indicator is built and how it is commonly read. It is not investment advice, not a recommendation and not a signal service. No indicator is profitable on its own — each is a way of describing a market, and any rule built on one has to be tested with realistic costs before it is traded.