Trading Indicator

Using ADX in Automated Trading

ADX measures trend strength, while +DI and -DI add directional context. Learn how to use ADX as a filter for automated trend strategies in Tradeworks.

ADX indicator showing trend strength with plus DI and minus DI lines in Tradeworks

Understanding ADX

Average Directional Index (ADX) is an indicator used to measure the strenght of the trend. ADX indicator consists of three lines: ADX line, as well as the +DI (positive directional indicator) and -DI (negative directional indicator). +DI and -DI are calculated on the basis of the high, low and closing prices. ADX is a smoothed average of these two lines. ADX ranges between 0 and 100. Values below 20 indicate lack of trend and the values above 25 indicate that the market is trending. ADX does not attempt to predict the direction of the trend itself.

The Average Directional Index (ADX) measures trend strength. It helps automated strategies decide whether a trend-following setup should be allowed, paused, or filtered out.

ADX does not show whether the market is moving up or down. Direction should come from +DI and -DI, a Moving Average, MACD, price conditions, or another directional rule.

Key takeaway

ADX tells you whether the market is trending, not whether to buy or sell. Use ADX with +DI/-DI, Moving Average, MACD, or price conditions for directional rules.

Strategy 1: ADX Trend Strength Filter with Moving Average Direction

Use ADX to allow trades only when market conditions are trending, while Moving Average direction determines long or short entries.

Setup

  • Add ADX as the trend-strength filter.
  • Add a 50-period Moving Average as the direction filter.
  • Add ATR if you want volatility-based exits.

Trade Management

  • Open Position Buy Signal: Strategy symbol ASK price is greater than Moving Average (50) AND ADX is greater than 25.
  • Open Position Sell Signal: Strategy symbol BID price is less than Moving Average (50) AND ADX is greater than 25.
  • Stop Loss Exit Signal, long: Strategy symbol BID price is less than entry price minus 2x ATR.
  • Take Profit Exit Signal, long: Strategy symbol BID price is greater than entry price plus 3x ATR.
  • Stop Loss Exit Signal, short: Strategy symbol ASK price is greater than entry price plus 2x ATR.
  • Take Profit Exit Signal, short: Strategy symbol ASK price is less than entry price minus 3x ATR.
ADX trend strength filter combined with Moving Average direction in Tradeworks

Strategy 1: Moving Average provides direction; ADX filters for trend strength above the tested threshold.

Strategy 2: +DI / -DI Directional Crossover with ADX Filter

Use +DI and -DI for direction, then require ADX to confirm that the market is trending.

Setup

  • Add ADX with +DI and -DI lines enabled.
  • Use ADX as the trend-strength filter.
  • Add ATR for Stop Loss Exit Signal and Take Profit Exit Signal distances.

Trade Management

  • Open Position Buy Signal: +DI crosses from below to above -DI AND ADX is greater than 25.
  • Open Position Sell Signal: -DI crosses from below to above +DI AND ADX is greater than 25.
  • Avoid Entry Rule: Do not open trend-following entries when ADX is less than 20.
  • Stop Loss Exit Signal: Use ATR-based distance from entry, using BID for long exits and ASK for short exits.
  • Take Profit Exit Signal: Use ATR multiple or tested fixed target, using BID for long exits and ASK for short exits.
Plus DI and minus DI crossover strategy filtered by ADX trend strength

Strategy 2: +DI/-DI provide direction; ADX confirms trend strength before entry.

Strategy 3: ADX Range Avoidance Filter for Trend Bots

Use ADX to block trend-following entries when market conditions lack enough trend strength.

Setup

  • Add ADX as the market-condition filter.
  • Keep your existing trend signal from Moving Average, MACD, or Parabolic SAR.
  • Add ATR if you want volatility-adjusted exits.

Trade Management

  • Allow Entry Rule: Main trend signal is active AND ADX is greater than tested threshold, commonly 25.
  • Block Entry Rule: Do not open trend-following entries when ADX is less than 20.
  • Neutral Zone: If ADX is between 20 and 25, require extra confirmation from price/MA or DI alignment.
  • Exit Signals: Keep Stop Loss Exit Signal and Take Profit Exit Signal separate from the ADX entry filter.
ADX range avoidance filter blocking trend entries during low trend strength conditions

Strategy 3: ADX acts as a permission filter for trend bots and blocks low-trend conditions.

For Bot Developers: Implementation Tips

In Tradeworks, ADX works as a condition filter. Build entry direction from +DI/-DI, Moving Average, MACD, or price rules, then require ADX to be above a tested threshold before allowing the trade.

Implementation checklist

  • Use ADX for trend strength, not direction.
  • Use +DI/-DI or another directional signal for long/short logic.
  • Use ADX > 25 as the CSV reference for trending conditions, then backtest thresholds.
  • Use ADX < 20 as a low-trend filter for trend-following strategies.
  • Keep Stop Loss Exit Signal and Take Profit Exit Signal independent from ADX.

Manageable Beginner Setup

Example setup

  • Primary direction: Moving Average (50) or +DI/-DI crossover
  • Trend-strength filter: ADX > 25
  • Avoid trading filter: ADX < 20
  • Exit method: ATR-based Stop Loss Exit Signal and Take Profit Exit Signal
  • Example timeframes: 1-hour and 4-hour
  • Example pairs: EUR/USD, GBP/USD, AUD/USD, EUR/GBP

Common pitfalls

  • Using ADX as a standalone buy/sell signal.
  • Forgetting that ADX does not show direction.
  • Treating ADX rising as automatically bullish.
  • Using trend strategies when ADX is below 20.
  • Forgetting BID for long exits and ASK for short exits.
?

Questions

Frequently Asked Questions

What is ADX? +

ADX is a trend-strength indicator with three lines: the ADX line, +DI, and -DI. It helps identify whether market conditions are trending, but it does not provide trade direction by itself.

Does ADX show trend direction? +

No. ADX measures strength only. Direction should come from +DI and -DI, Moving Average, MACD, price conditions, or another directional rule.

What do +DI and -DI mean? +

+DI is the positive directional indicator and -DI is the negative directional indicator. They provide directional context while ADX measures the strength of the trend condition.

What ADX value indicates a trending market? +

The source documentation states that values above 25 indicate that the market is trending, while values below 20 indicate lack of trend. Treat these as reference levels and test thresholds before using them in live automation.

How should ADX be used in automated trading? +

Use ADX as a filter that allows or blocks trend-following entries. Build direction from +DI/-DI, Moving Average, MACD, or price rules, then require ADX to meet the trend-strength condition.

Can ADX be used alone? +

No. ADX should be combined with a directional condition such as +DI/-DI, Moving Average, MACD, or price rules. ADX alone does not tell the bot whether to buy or sell.

Try it in Tradeworks

Want to try Average Directional Movement Index in Tradeworks?

Build and test average directional movement index rules in a no-code strategy builder before deciding whether they fit your trading approach.

Volume Indicators

Volume indicators measure the strength of price movements by analyzing trading volume. They help confirm trends and identify potential reversals.

Volatility Indicators

Volatility indicators measure the rate of price change. They help traders set stop losses, determine risk levels, and identify potential breakouts.

Bill Williams Indicators

A collection of indicators developed by Bill Williams for trend identification, momentum analysis, and fractal pattern recognition.