Average Directional Index
systemic:core-adxIndicatorsInputs
| Name | Type | Description |
|---|---|---|
| Window | Whole number | The number of bars used to smooth the +DM, -DM, and TR values and then the ADX. |
| Price High | Number series | The highest price of each bar. |
| Price Low | Number series | The lowest price of each bar. |
| Price Close | Number series | The closing (last) price of each bar. |
Outputs
| Name | Type | Description |
|---|---|---|
| ADX | Number series | The strength of the trend on each bar, from 0 to 100, whatever its direction. |
| +DI | Number series | The strength of upward price movement on each bar, as a percentage of the True Range. |
| -DI | Number series | The strength of downward price movement on each bar, as a percentage of the True Range. |
Cost
0.198 + 0.0179·n credits for n bars, rounded up. The marks are each plan's limit of bars.
How to use the Average Directional Index (ADX) to measure trend strength, filter trades, and tell trending markets from ranging ones in equities and cryptocurrencies.
Overview
The Average Directional Index (ADX), developed by J. Welles Wilder, is a widely used indicator that measures the strength of a trend, whatever its direction. It is part of the Directional Movement System, which also includes the Positive Directional Indicator (+DI) and Negative Directional Indicator (−DI). This module returns all three.
Why it matters:
- In equities, ADX helps tell trending markets from ranging ones, which improves timing for trend-following and mean-reversion strategies Investopedia ADX.
- In crypto, where volatility and false breakouts are common, ADX helps filter out noise and focus on strong trends Binance Academy ADX.
Mathematical Formulation
The ADX is calculated in several steps:
-
Directional Movement (+DM, −DM):
- (if positive and greater than , else 0)
- (if positive and greater than , else 0)
-
True Range (TR):
-
Smoothed Averages:
- , , and are smoothed with Wilder's method over bars, where is the Window (typically )
-
Directional Indicators:
- Directional Movement Index (DX):
- Average Directional Index (ADX):
- ADX is the smoothed average of over bars. The first ADX value is the simple average of the first DX values.
Calculation Flow
graph TD
A[High, Low, Close] --> B[Compute +DM, -DM]
A --> C[Compute TR]
B --> D[Smoothed +DM, -DM]
C --> E[Smoothed TR]
D --> F[+DI, -DI]
E --> F
F --> G[DX]
G --> H[Smoothed ADX]
H --> I[Plot ADX vs Price]
Interpreting ADX: Trend Strength and Regimes
Regime Thresholds
- ADX < 20: Weak or non-trending market (range-bound)
- ADX 20–25: Emerging trend
- ADX > 25: Strong trend (trend-following favored)
- Rising ADX: Trend is strengthening
- Falling ADX: Trend is weakening
Stylized Regimes
flowchart TD
A[ADX Rising, >25] --> B[Strong Trend, Trade with Trend]
A2[ADX Falling, >25] --> C[Trend Exhaustion, Watch for Reversal]
D[ADX < 20] --> E[Range-Bound, Mean Reversion]
Example: Filtering Trades
- Only enter trend-following trades when ADX > 25 and rising.
- Avoid new positions or use mean-reversion strategies when ADX < 20.
Use in Securities and Cryptocurrencies
- Equities:
- Confirm breakouts: If price breaks resistance and ADX rises above 25, the move is more likely to hold StockCharts ADX.
- Avoid whipsaws: Stay out of choppy markets when ADX is low.
- Cryptocurrencies:
- Filter out false breakouts: Crypto markets often have volatility spikes. ADX helps focus on real trends.
- Combine with +DI/−DI: Use +DI and −DI to read the trend direction, and ADX to confirm its strength Binance Academy ADX.
Example (Bitcoin)
Suppose Bitcoin breaks above a key resistance and ADX rises from 18 to 30. This suggests a strong uptrend, which favors trend-following strategies.
Stylized Trading Flow
flowchart TD
S[Market Scan] --> A1{ADX > 25 and Rising?}
A1 -->|Yes| B1[Trend-Following Signal]
A1 -->|No| A2{ADX < 20?}
A2 -->|Yes| B2[Mean Reversion or Stand Aside]
A2 -->|No| B3[Wait for Clear Signal]
Heuristics:
- ADX rising above 25: Confirm trend, consider adding to positions
- ADX falling or < 20: Reduce risk, avoid trend trades
Practical Implementation Notes
- Data hygiene: Use consistent price data, especially in crypto where prices differ between exchanges Binance Academy ADX.
- Backtesting: Test ADX signals together with price action and other indicators (e.g., RSI, MACD) for confirmation.
- Risk controls: ADX works best as a filter, not as a signal on its own. Your own stop-loss and position-sizing rules still matter.
References and Further Reading
- Investopedia: Average Directional Index (ADX)
- StockCharts: Average Directional Index (ADX)
- Binance Academy: Average Directional Index
- CMT Association: Directional Movement System
Appendix: Quick Glossary
- ADX: Average Directional Index, measures trend strength
- +DI/−DI: Positive/Negative Directional Indicators, measure trend direction
- True Range (TR): Largest of high-low, high-previous close, low-previous close
- Trend-following: Trading in the direction of the prevailing trend
- Mean reversion: Trading against extremes, expecting a return to average
Missing Data
- Which bars count: A bar is used only when Price High and Price Low are both present. Price Close is optional: if the previous close is missing, True Range is that bar's High − Low.
- Gaps: A bar without High or Low (holiday, weekend, no data) is empty in all three outputs. No value is carried forward. The Window counts only bars with data, so the smoothing goes straight from the last bar before a gap to the first bar after it.
- Warm-up: +DI and −DI are empty for the first
windowbars with data. ADX averageswindowDX values on top of that, so it is empty for the first 2 ×window− 1 bars (27 bars for a window of 14). - Flat prices: If High and Low have not moved at all since the start of the run, +DI and −DI are both 0. DX cannot be computed, so ADX is empty on those bars.
Indicator Assessment
---
config:
xyChart:
width: 600
height: 400
themeVariables:
xyChart:
plotColorPalette: "#2ecc71, #e74c3c"
---
xychart-beta horizontal
title "ADX Indicator Assessment (Scale: 1-10)"
x-axis ["Popularity", "Reliability", "Complexity", "Versatility", "Recent Interest"]
y-axis "Score" 0 --> 10
bar [9, 7, 5, 8, 6]
bar [7, 6, 5, 7, 7]
Legend: First bar (green) = Equities/Forex | Second bar (red) = Cryptocurrency
Dimension Explanations
| Dimension | Equities/Forex | Crypto | Rationale |
|---|---|---|---|
| Popularity | 9 | 7 | One of the most cited trend indicators; developed by J. Welles Wilder and published in his 1978 book. Widely used in forex and equities, and common among crypto traders. |
| Reliability | 7 | 6 | Effective as a trend strength filter. The +DI/−DI crossovers add direction. Slightly less reliable in crypto because of frequent whipsaws and 24/7 trading. |
| Complexity | 5 | 5 | Moderate. You need to understand True Range, directional movement, and smoothing. Less intuitive than a simple moving average, but well documented. |
| Versatility | 8 | 7 | Works on all periods and asset classes, alone as a filter or combined with other indicators. The Window input lets you tune it for different trading styles. |
| Recent Interest | 6 | 7 | Steady interest in traditional markets. Growing use in crypto as traders look for trend filters that cope with volatility. |