Systemicbeta

Average Directional Index

systemic:core-adxIndicators

Inputs

NameTypeDescription
WindowWhole numberThe number of bars used to smooth the +DM, -DM, and TR values and then the ADX.
Price HighNumber seriesThe highest price of each bar.
Price LowNumber seriesThe lowest price of each bar.
Price CloseNumber seriesThe closing (last) price of each bar.

Outputs

NameTypeDescription
ADXNumber seriesThe strength of the trend on each bar, from 0 to 100, whatever its direction.
+DINumber seriesThe strength of upward price movement on each bar, as a percentage of the True Range.
-DINumber seriesThe strength of downward price movement on each bar, as a percentage of the True Range.

Cost

19
credits per run
1,000
bars

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:

  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:

    • +DM+DM, −DM-DM, and TRTR are smoothed with Wilder's method over NN bars, where NN is the Window (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 bars. The first ADX value is the simple average of the first NN 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


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 window bars with data. ADX averages window DX 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

DimensionEquities/ForexCryptoRationale
Popularity97One 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.
Reliability76Effective as a trend strength filter. The +DI/−DI crossovers add direction. Slightly less reliable in crypto because of frequent whipsaws and 24/7 trading.
Complexity55Moderate. You need to understand True Range, directional movement, and smoothing. Less intuitive than a simple moving average, but well documented.
Versatility87Works 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 Interest67Steady interest in traditional markets. Growing use in crypto as traders look for trend filters that cope with volatility.
Rendering diagrams...
© 2026 WanoLabs. All rights reservedBeta v0.1.5