Most traders use ADX without understanding how it is calculated. The formula reveals exactly what ADX measures and why it behaves the way it does.
The ADX indicator formula calculates trend strength through a multi-step process starting from raw price data. Understanding the calculation is not required to use ADX, but it explains why the indicator behaves the way it does, why it lags, and why it is deliberately directionless by design. The formula makes the behavior predictable rather than mysterious.
ADX measures the degree to which price movement is directional rather than random. If price moved 5% across a period but split evenly between up and down moves, there was significant price activity but no net direction. If price moved 5% consistently in one direction, there was both significant activity and strong directional conviction. ADX measures the second property: how lopsided the directional movement is.
The formula achieves this in five sequential steps. First, True Range measures total price movement per bar, the denominator. Second, Directional Movement separates that total into upward and downward components. Third, smoothing averages both over the lookback period. Fourth, the Directional Indicators (+DI and -DI) express upward and downward movement as proportions of total movement. Fifth, ADX averages the separation between +DI and -DI over time.
Each step feeds the next. Understanding what each step is trying to capture makes the formula intuitive rather than mechanical. The calculation is not arbitrary: every component measures a specific property that the final ADX reading requires.
True Range (TR) is the maximum of three values for each bar:
The first value captures the intraday range. The second and third values capture gaps from the previous close. If BTC closes at $30,000 and opens at $31,000 the next day, the standard high-low range misses the $1,000 overnight gap. True Range captures it because the second value includes the distance from the previous close to the current high.
True Range is always a positive number representing the total range of price movement during the bar, including any gap from the previous close. It serves as the denominator in the Directional Indicator calculation, normalizing directional movement relative to total movement. Without this normalization, a volatile bar would produce misleadingly large directional movement values compared to a quiet bar.
For each bar, calculate +DM (Positive Directional Movement) and -DM (Negative Directional Movement):
+DM: If the upward move (current high minus previous high) is greater than the downward move (previous low minus current low), and the upward move is positive, then +DM equals that upward move. Otherwise +DM is zero.
-DM: If the downward move (previous low minus current low) is greater than the upward move, and the downward move is positive, then -DM equals that downward move. Otherwise -DM is zero.
On any given bar, only the larger of the two is non-zero. If neither is positive (an inside bar where today's range is entirely within yesterday's range), both are zero.
+DM captures how much higher today's high extends beyond yesterday's high, the upward reach of price. -DM captures how much lower today's low extends below yesterday's low, the downward reach. They measure which direction price is extending toward, not the entire bar range.
Wilder uses his own smoothing method to smooth +DM, -DM, and TR over the lookback period. The formula for Wilder's Smoothed Moving Average (WSMA) after the initial period:
WSMA(today) = WSMA(yesterday) minus (WSMA(yesterday) / 14) plus today's value
The first WSMA value uses a simple sum of the first 14 bars. Subsequent values use the recursive formula above. This smoothing is similar to an exponential moving average but not identical: it uses a different weighting scheme. Most charting platforms implement Wilder's smoothing correctly by default.
The three smoothed values produced are: Smoothed +DM (the accumulated 14-period upward directional movement), Smoothed -DM (the accumulated 14-period downward directional movement), and Smoothed TR (the accumulated 14-period True Range). These form the inputs to the next calculation step.
From the smoothed values:
+DI = 100 x (Smoothed +DM / Smoothed TR)
-DI = 100 x (Smoothed -DM / Smoothed TR)
+DI expresses upward directional movement as a percentage of total movement. -DI expresses downward directional movement the same way. When +DI is 30 and -DI is 10, approximately 30% of recent price movement was directed upward and 10% was directed downward.
The Directional Index (DX) measures the separation between +DI and -DI:
DX = 100 x |+DI minus -DI| / (+DI plus -DI)
When +DI and -DI are equal, DX is 0, no directional bias. When +DI is 30 and -DI is 10, DX = 100 x (20 / 40) = 50. When +DI is 35 and -DI is 5, DX = 100 x (30 / 40) = 75. DX rises as the directional contest becomes more lopsided.
ADX = Wilder's 14-period smoothed average of DX values
ADX is the running smoothed average of DX. It rises when DX has been consistently elevated (sustained directional conviction) and falls when DX has been low or inconsistent. It reflects the average directional conviction over the lookback period, not the current bar's value.
For the full DMI context, see The DMI Indicator and What Is ADX?
ADX rises in both uptrends and downtrends. DX uses the absolute value of |+DI minus -DI|, not the signed difference. Whether +DI exceeds -DI or -DI exceeds +DI, the result is the same positive value. ADX has no directional awareness. It only measures how lopsided the contest is. This is by design: ADX was built to classify trend strength without encoding a directional bias.
ADX lags. Both DI and ADX involve smoothing over 14 periods. A new trend must be sustained for multiple bars before the smoothed values significantly reflect it. This is the intended tradeoff: lower noise at the cost of delayed confirmation.
ADX can be rising while price oscillates. If price consistently makes new highs during a corrective zigzag pattern, +DM values accumulate. The smoothed +DM increases relative to smoothed TR even though the price chart looks choppy. ADX reflects the net directional activity over the full lookback window, not just the most recent bars.
ADX detects trend deceleration before a visual reversal. When a trend begins making smaller new highs, +DM values shrink. Smoothed +DM decreases relative to smoothed TR. DX declines. ADX follows with a lag. The indicator detects deceleration before the trend visibly reverses on the price chart, which is why ADX peaking and turning down is an early warning signal, not a lagging one relative to trend health.
Directional information. The absolute value in the DX formula removes all direction. ADX is deliberately constructed to be directionless. Direction is available in +DI and -DI: they are separate outputs of the same calculation, designed to be read alongside ADX rather than replaced by it.
Prediction. Every component derives from past price data. The smoothing adds further backward-looking bias. ADX cannot and does not produce predictive signals. It measures conditions over the lookback period, which provides probabilistic context for current market state.
Precise entry or exit timing. ADX reflects the average state over the lookback period. The specific moment when a trend begins or ends is not captured with precision. ADX functions as a regime classifier (trending vs ranging) rather than as a precise entry or exit timer. For entry timing, the +DI/-DI crossover or the Parabolic SAR flip are more precise: they respond to individual bars rather than smoothed averages.
The ADX formula runs in five steps: (1) calculate True Range per bar as the maximum of three values; (2) calculate +DM and -DM directional movement per bar; (3) smooth +DM, -DM, and TR over 14 periods using Wilder's smoothing; (4) calculate +DI = 100 x (Smoothed +DM / Smoothed TR) and -DI = 100 x (Smoothed -DM / Smoothed TR), then DX = 100 x |+DI minus -DI| / (+DI plus -DI); (5) ADX = 14-period Wilder's smoothed average of DX values.
Step 1: Calculate True Range as max(high-low, |high-previous close|, |low-previous close|). Step 2: Calculate +DM (upward extension beyond previous high) and -DM (downward extension below previous low), only the larger of the two is non-zero per bar. Step 3: Smooth all three over 14 periods using Wilder's smoothing method. Step 4: +DI = 100 x smoothed +DM / smoothed TR; -DI = 100 x smoothed -DM / smoothed TR; DX = 100 x |+DI minus -DI| / (+DI plus -DI). Step 5: ADX = 14-period Wilder's smooth of DX.
True Range is the maximum of three values for each bar: current high minus current low, the absolute difference between the current high and the previous close, and the absolute difference between the current low and the previous close. The second and third values capture overnight gaps that the standard high-low range misses. True Range serves as the denominator in the Directional Indicator calculation, normalizing directional movement relative to total price movement per bar.
+DI (Positive Directional Indicator) and -DI (Negative Directional Indicator) express upward and downward directional movement as percentages of total price movement. +DI = 100 x (Smoothed +DM / Smoothed TR). -DI = 100 x (Smoothed -DM / Smoothed TR). When +DI is above -DI, upward directional movement is dominant. When -DI is above +DI, downward movement is dominant. Their separation is what ADX measures: the degree to which one side is winning the directional contest.
ADX uses the absolute value of the difference between +DI and -DI in the DX formula: DX = 100 x |+DI minus -DI| / (+DI plus -DI). The absolute value means the sign of the difference is discarded. Whether +DI exceeds -DI (uptrend) or -DI exceeds +DI (downtrend), the DX value is the same positive number. ADX is the smoothed average of DX: it measures how lopsided the directional contest is, not which side is winning. This directionless design was intentional: ADX was built to classify trend strength, not trend direction.
Wilder's Smoothed Moving Average (WSMA) uses the formula: WSMA(today) = WSMA(yesterday) minus (WSMA(yesterday) / period) plus today's value. A standard EMA uses: EMA(today) = previous EMA + multiplier x (today's value minus previous EMA), where multiplier = 2 / (period + 1). For a 14-period calculation, EMA uses a multiplier of 0.1333, while WSMA effectively uses 0.0714 (1/14). Wilder's smoothing weights recent values less than a standard EMA of the same period, producing a slower, smoother line. The difference is small but produces slightly different ADX values.
Yes. You need a spreadsheet with OHLC price data. Calculate True Range, +DM, and -DM for each bar. Sum the first 14 bars to get the initial smoothed values. Apply Wilder's recursive formula for each subsequent bar. Calculate +DI and -DI from the smoothed values. Calculate DX from +DI and -DI. Apply Wilder's smoothing to DX to produce ADX. The calculation is straightforward but tedious for long datasets. Any discrepancy between manual calculation and a platform's ADX output is typically due to differences in how the initial 14-bar sum is handled or which smoothing method the platform uses.