TickAtlas
Analysis 9 min read · March 28, 2026

ADX: How to Measure Trend Strength in Your Trading Bot

Learn how the ADX indicator measures trend strength, not direction, and how to use it as a filter to dramatically improve your bot's signal quality.

CG
By the TickAtlas team

What ADX Actually Measures

Most indicators tell you which direction the market is moving. ADX (Average Directional Index) tells you how strongly it is moving, regardless of direction. An ADX of 40 means a strong trend — it could be a strong uptrend or a strong downtrend. This makes ADX uniquely valuable as a filter rather than a signal generator.

ADX Interpretation

0-15: No trend (avoid trend strategies)
15-25: Weak trend (use caution)
25-40: Strong trend (trend strategies work)
40+: Very strong trend (ride it)

The API Response

json
// GET /v1/indicators?symbol=EURUSD&timeframe=H1&indicators=ADX_14
{
  "success": true,
  "data": {
    "symbol": "EURUSD",
    "timeframe": "H1",
    "indicators": {
      "ADX_14": {
        "value": 28.4,
        "plus_di": 22.1,
        "minus_di": 18.3
      }
    },
    "timestamp": "2026-03-28T14:00:00Z"
  }
}

The API returns three components: the ADX value itself, +DI (bullish directional index), and -DI (bearish directional index). While ADX measures strength, the DI lines tell you the direction.

ADX as a Strategy Router

The most powerful use of ADX is to switch between strategies based on market conditions. When the market is trending, use a trend-following strategy. When it is ranging, use a mean-reversion strategy.

python
import requests

API_KEY = "your_api_key_here"
BASE_URL = "https://tickatlas.com/v1"

def adaptive_strategy(symbol: str) -> str:
    """Switch strategies based on ADX reading."""
    resp = requests.get(f"{BASE_URL}/indicators", params={
        "symbol": symbol,
        "timeframe": "H1",
        "indicators": "ADX_14,RSI_14,MACD,EMA_9,EMA_21"
    }, headers={"X-API-Key": API_KEY})

    data = resp.json()["data"]["indicators"]
    adx = data["ADX_14"]["value"]
    plus_di = data["ADX_14"]["plus_di"]
    minus_di = data["ADX_14"]["minus_di"]
    rsi = data["RSI_14"]["value"]
    macd_hist = data["MACD"]["histogram"]

    if adx > 25:
        # TRENDING MARKET — use MACD + DI direction
        if plus_di > minus_di and macd_hist > 0:
            return f"TREND BUY (ADX: {adx:.1f}, +DI: {plus_di:.1f})"
        elif minus_di > plus_di and macd_hist < 0:
            return f"TREND SELL (ADX: {adx:.1f}, -DI: {minus_di:.1f})"
    else:
        # RANGING MARKET — use RSI mean reversion
        if rsi < 30:
            return f"RANGE BUY (ADX: {adx:.1f}, RSI: {rsi:.1f})"
        elif rsi > 70:
            return f"RANGE SELL (ADX: {adx:.1f}, RSI: {rsi:.1f})"

    return f"HOLD (ADX: {adx:.1f})"

# Scan pairs
for pair in ["EURUSD", "GBPUSD", "USDJPY", "XAUUSD"]:
    print(f"{pair}: {adaptive_strategy(pair)}")

DI Crossover Signals

The +DI and -DI lines generate directional signals. When +DI crosses above -DI, it signals a bullish trend. When -DI crosses above +DI, it signals bearish. But only take these signals when ADX confirms the trend is strong.

python
def di_crossover(symbol: str) -> str:
    """Detect DI crossover when ADX confirms trend strength."""
    resp = requests.get(f"{BASE_URL}/indicators", params={
        "symbol": symbol,
        "timeframe": "H4",
        "indicators": "ADX_14"
    }, headers={"X-API-Key": API_KEY})

    adx_data = resp.json()["data"]["indicators"]["ADX_14"]
    adx = adx_data["value"]
    plus_di = adx_data["plus_di"]
    minus_di = adx_data["minus_di"]

    # Only signal when ADX > 20 (trend exists)
    if adx < 20:
        return "NO_TREND"

    di_spread = abs(plus_di - minus_di)

    # Strong directional move: large DI spread + high ADX
    if plus_di > minus_di and di_spread > 5:
        return f"BULLISH (ADX: {adx:.1f}, +DI leads by {di_spread:.1f})"
    elif minus_di > plus_di and di_spread > 5:
        return f"BEARISH (ADX: {adx:.1f}, -DI leads by {di_spread:.1f})"

    return "NEUTRAL"

ADX Patterns to Watch

Rising ADX from Below 20

A new trend is forming. This is the ideal time to enter a trend-following position. Check DI lines for direction.

ADX Above 40 and Falling

The trend is exhausting. Take profits on existing trend positions. Do not enter new trend trades.

ADX Below 20 for Extended Period

The market is in a tight range. This often precedes a significant breakout. Use Bollinger Band squeeze detection to catch the breakout.

DI Lines Converging

When +DI and -DI come close together, the trend is weakening. Prepare to switch from trend strategy to range strategy.

Why Every Bot Needs ADX

The single biggest improvement you can make to any trading bot is adding an ADX filter. Most false signals happen when trend strategies are applied to ranging markets, or range strategies are applied to trending markets. ADX solves this. It is not glamorous, but it is the difference between a bot that bleeds money during consolidation and one that stays flat, waiting for the right conditions.

Further Reading

Try this with live data

Every account gets $2.50 in free PAYG credits. No card required — paste your API key and run the code above against live broker data.