All indicators

Crossing Moving Averages with ADX Filter)

Feb 13, 2026

Static chart image
SignalsMoving AveragesVolatility

The Crossing Moving Averages with ADX Filter indicator provides a dual-layer trend-following system designed to identify momentum shifts while filtering for trend strength using the Average Directional Index.

Usage

The Crossing Moving Averages with ADX Filter can be used to capture sustained trends in various markets, particularly Short-Term Interest Rates (STIRs) such as ZQ, SR3, Euribor, and SONIA, as well as Forex pairs. Users can interpret the signals based on the relationship between the two moving averages and the strength of the underlying trend.

  • Trend Identification: A long bias is established when the Fast Moving Average crosses above the Slow Moving Average. Conversely, a short bias is established when the Fast Moving Average crosses below the Slow Moving Average.
  • Trend Strength Filtering: By enabling the ADX filter, the script ensures that entries only occur when the trend strength exceeds a user-defined threshold (default is 20). This helps in avoiding "whipsaw" conditions during sideways or choppy market phases.
  • Strategy Configurations: Common setups include using a 20-period Fast MA and a 120-period Slow MA for medium-term CTA-style trend following, or a 50-period and 200-period combination for long-term trend analysis.

Details

This script implements a flexible crossover logic combined with an Average Directional Index (ADX) calculation based on Wilder’s Smoothing (RMA). The primary objective is to align trading signals with periods of high directional conviction.

The moving average calculation is versatile, allowing users to choose between Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA), and Running Moving Average (RMA). The ADX component calculates the Directional Movement Index (+DI and -DI) to determine the DX, which is then smoothed to provide the final ADX value. Signals are only triggered when the MA crossover aligns with an ADX value higher than the specified threshold, ensuring the market is not in a low-volatility consolidation state.

Settings

Moving Average Settings

  • Fast MA Length: Sets the lookback period for the shorter, more reactive moving average.
  • Slow MA Length: Sets the lookback period for the longer, trend-defining moving average.
  • Moving Average Type: Allows selection between SMA, EMA, WMA, and RMA for the trend calculations.

ADX Settings

  • Enable ADX Filter: A toggle to determine whether the ADX threshold must be met to trigger a signal.
  • ADX Length: The period used to calculate the directional movement and the resulting ADX.
  • ADX Threshold: The minimum value required for the ADX to validate a trend. Values above 20 or 25 typically indicate a trending market.

FAQ

What markets are best suited for this indicator?

While applicable to any trending asset, it is specifically optimized for Short-Term Interest Rate (STIR) futures and Forex markets which often exhibit long-term directional trends.

Can I change the sensitivity of the trend detection?

Yes, by adjusting the Moving Average Type and lengths, you can calibrate the script for high-frequency medium-term movements or slow, long-term macro trends.

How do I access this tool?

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.