Systemicalpha

Average Directional Index

systemic:core-adxIndicatorsfunction1 cr

Inputs

NameTypeDescription
Windowinteger**Window** refers to the time period over which the ADX is calculated. Commonly, a 14-day window is used, but this can be adjusted depending on the trader's strategy and the timeframe being analyzed.
Price Highfloatarray**Price High** refers to the highest price of a security during a specific time period (e.g., daily, hourly). It is used to determine the positive directional movement (+DM) for the period. The +DM is calculated by comparing the current high price with the previous high price.
Price Lowfloatarray**Price Low** refers to the lowest price of a security during a specific time period. It is used to determine the negative directional movement (-DM) for the period. The -DM is calculated by comparing the current low price with the previous low price.
Price Closefloatarray**Price Close** is the last traded price of a security at the end of a specific time period. It is used to compute the True Range (TR), which is a key component in the ADX calculation. The TR is the maximum of the following three values:

Outputs

NameTypeDescription
ADXfloatarray**ADX** is a measure of the strength of a trend, regardless of its direction. It is derived from the smoothed average of the Directional Movement Index (DX) values over a specific period (often 14 days). ADX values range from 0 to 100, with higher values indicating a stronger trend.
+DIfloatarray**+DI** represents the positive directional movement of a security. It measures the extent to which the price is moving higher during a specific period relative to the previous period. +DI is derived from the smoothed average of positive directional movements (+DM) and is expressed as a percentage of the smoothed True Range (TR).
-DIfloatarray**-DI** represents the negative directional movement of a security. It measures the extent to which the price is moving lower during a specific period relative to the previous period. -DI is derived from the smoothed average of negative directional movements (-DM) and is expressed as a percentage of the smoothed True Range (TR).

A comprehensive guide to using the Average Directional Index (ADX) for measuring trend strength, filtering trades, and regime classification in equities and cryptocurrencies.


Overview

The Average Directional Index (ADX), developed by J. Welles Wilder, is a widely used technical indicator that quantifies the strength of a trend, regardless of its direction. It is a core component of the Directional Movement System, which also includes the Positive Directional Indicator (+DI) and Negative Directional Indicator (−DI).

Why it matters:

  • In equities, ADX helps distinguish between trending and ranging markets, improving timing for trend-following and mean-reversion strategies Investopedia ADX.
  • In crypto, where volatility and false breakouts are common, ADX can help filter out noise and focus on robust trends Binance Academy ADX.

Mathematical Formulation

The ADX is calculated in several steps:

  1. Directional Movement (+DM, −DM):

    • +DMt=Hight−Hight−1+DM_t = \text{High}_t - \text{High}_{t-1} (if positive and greater than Lowt−1−Lowt\text{Low}_{t-1} - \text{Low}_t, else 0)
    • −DMt=Lowt−1−Lowt-DM_t = \text{Low}_{t-1} - \text{Low}_t (if positive and greater than Hight−Hight−1\text{High}_t - \text{High}_{t-1}, else 0)
  2. True Range (TR):

TRt=max⁡(Hight−Lowt,∣Hight−Closet−1∣,∣Lowt−Closet−1∣)TR_t = \max(\text{High}_t - \text{Low}_t, |\text{High}_t - \text{Close}_{t-1}|, |\text{Low}_t - \text{Close}_{t-1}|)
  1. Smoothed Averages:

    • Smoothed +DM+DM, −DM-DM, and TRTR over NN periods (typically N=14N=14)
  2. Directional Indicators:

+DIt=(Smoothed +DMtSmoothed TRt)×100+DI_t = \left(\frac{\text{Smoothed } +DM_t}{\text{Smoothed } TR_t}\right) \times 100 −DIt=(Smoothed −DMtSmoothed TRt)×100-DI_t = \left(\frac{\text{Smoothed } -DM_t}{\text{Smoothed } TR_t}\right) \times 100
  1. Directional Movement Index (DX):
DXt=∣+DIt−−DIt∣+DIt+−DIt×100DX_t = \frac{|+DI_t - -DI_t|}{+DI_t + -DI_t} \times 100
  1. Average Directional Index (ADX):
    • ADX is the smoothed average of DXtDX_t over NN periods.

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 likely robust StockCharts ADX.
    • Avoid whipsaws: Stay out of choppy markets when ADX is low.
  • Cryptocurrencies:
    • Filter out false breakouts: Crypto markets are prone to volatility spikes; ADX helps focus on real trends.
    • Combine with +DI/−DI: Use the direction of +DI and −DI to gauge trend direction, with ADX confirming strength Binance Academy ADX.

Example (Bitcoin)

Suppose Bitcoin breaks above a key resistance and ADX rises from 18 to 30. This suggests a strong, sustainable uptrend, favoring trend-following strategies.


Stylized Trading Flow

flowchart TD
    S[Market Scan] --> A1{ADX > 25 and Rising?}
    A1 -->|Yes| B1[Trend-Following Entry]
    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 exchange feeds may differ Binance Academy ADX.
  • Backtesting: Test ADX signals with price action and other indicators (e.g., RSI, MACD) for confirmation.
  • Risk controls: ADX is best used as a filter, not a standalone signal. Combine with stop-losses and position sizing.

References and Further Reading


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

ADX needs High and Low together on every bar it uses — Price Close is read opportunistically for gap-aware True Range when available, and never required: a bar is never blanked by a missing Close (True Range simply falls back to that bar's High − Low range). The Window setting means N bars actually observed, not N calendar slots: on a market-closed gap (holiday, weekend, no data), the Wilder smoothing keeps counting back through real bars, bridging straight from the last session before the gap to the first session after it — gaps become gaps (None), never a sentinel 20/50/−50, never a carried-forward stale value. Two warm-ups stack: +DI/−DI need the first window observed bars before they exist, and ADX itself is a second Wilder average — of DX, derived from +DI/−DI — so it needs a further window observed DX readings on top of that before its own first value. A flat window (High and Low both constant, so up-moves and down-moves cancel) is the one case that legitimately produces +DI = -DI = 0.0; DX is then an honest 0/0 and reports as a gap, which in turn means ADX never accumulates and stays a gap for the whole series.


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

DimensionEquities/ForexCryptoRationale
Popularity97One of the most cited trend indicators; developed by J. Welles Wilder and featured in his seminal 1978 book. Widely adopted in forex and equities. Strong presence in crypto trading communities.
Reliability76Highly effective as a trend strength filter. The +DI/−DI crossovers add directional context. Slightly less reliable in crypto due to frequent whipsaws and 24/7 trading.
Complexity55Moderate complexity—requires understanding of True Range, directional movement, and smoothing. Not as intuitive as simple moving averages but well-documented.
Versatility87Applicable across all timeframes and asset classes. Works well as a standalone filter or combined with other indicators. The window parameter allows customization for different trading styles.
Recent Interest67Consistent interest in traditional markets. Growing adoption in crypto as traders seek robust trend filters to navigate volatility. Featured in many algorithmic trading systems.
Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5