All indicators

Moving Average ADX

Aug 25, 2015

Static chart image
Dynamic OverlaysSignalsMoving Averages

The Moving Average ADX indicator provides a visual trend-following solution by dynamically coloring a moving average based on directional strength and crossover conditions. It aims to help traders distinguish between trending and choppy market environments by integrating the Average Directional Index (ADX) directly onto the price action overlay.

Usage

The Usage of the Moving Average ADX involves monitoring the color changes of the plotted Weighted Moving Average (WMA) to determine the current market state.

  • Bullish Trend (Green): When the ADX is above the user-defined threshold and the Plus Directional Indicator (+DI) is higher than the Minus Directional Indicator (-DI), the moving average turns green.
  • Bearish Trend (Red): When the ADX is above the threshold and the -DI is higher than the +DI, the moving average turns red.
  • Choppy/Neutral (Default Chart Color): If the ADX value falls below the specified threshold, the moving average reverts to the default chart foreground color, signaling a lack of a clear trend or a range-bound market.

Traders often use this tool on hourly charts to filter out noise. By requiring the ADX to be above a specific limit (e.g., 18) before coloring the trend, the script reduces false signals during low-volatility periods.

Details

The script is constructed using two primary components: the Average Directional Index (ADX) for trend strength and a Weighted Moving Average (WMA) for price trend smoothing.

  1. Directional Movement: The script calculates the True Range (TR) and the Directional Movement (+DM and -DM) using a smoothed Moving Average (RMA).
  2. ADX Calculation: The ADX is derived from the absolute difference between +DI and -DI, divided by their sum, and then smoothed over a specific period.
  3. Visual Output: A WMA is plotted on the chart. Its color is determined by a conditional logic gate: it checks if the ADX is greater than the "ADX MA Active" setting and then evaluates which DI line is dominant.
  4. Alert Logic: The script includes built-in alert triggers that fire when a bullish or bearish DI crossover occurs while the ADX is above the required strength threshold.

This implementation refactors original concepts by @CapnOscar for modern compatibility and visual clarity.

Settings

  • DI Length: Determines the period used to calculate the Plus and Minus Directional Indicators.
  • ADX Smoothing: Sets the smoothing period for the ADX calculation to filter out minor fluctuations.
  • ADX MA Active: The minimum ADX value required for the moving average to display trend colors (Green/Red). Values below this threshold result in a neutral color.
  • Length: The lookback period for the Weighted Moving Average (WMA) plotted on the chart.
  • Source: The price input (e.g., Close, Open, HL2) used to calculate the moving average.

FAQ

What does it mean when the moving average turns black or the default chart color? This indicates that the ADX is below the "ADX MA Active" threshold, suggesting that the current market trend is weak or non-existent (choppy).

Can this indicator be used for scalping on lower timeframes? While originally optimized for hourly charts, the settings (DI Length and ADX Smoothing) can be adjusted for lower timeframes; however, users should be aware that ADX can lag in highly volatile, short-term environments.

How do I get access to the Moving Average ADX? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.