All indicators

MACD Crossover Trend Indicator

Jul 29, 2020

Static chart image
SignalsOscillatorsMoving Averages

The MACD Crossover Trend Indicator indicator provides filtered trading signals by combining MACD momentum crossovers with long-term trend direction. It aims to identify high-probability entry points by only triggering signals that align with the prevailing market trend as determined by a 200-period Exponential Moving Average (EMA).

Usage

The indicator identifies two primary signal types based on the relationship between price, the 200 EMA, and the MACD line:

  • Bullish Signal: Occurs when the price is trading above the 200 EMA and the MACD line crosses above the Signal line while below the zero level. This indicates a potential recovery within a sustained uptrend.
  • Bearish Signal: Occurs when the price is trading below the 200 EMA and the MACD line crosses below the Signal line while above the zero level. This suggests a potential breakdown within a sustained downtrend.

Traders often use these signals in conjunction with risk management techniques, such as placing stop losses near recent swing highs or lows and targeting a specific risk-to-reward ratio (e.g., 1:1.5).

Details

The script executes a trend-following logic by filtering MACD crossovers. The core components include:

  • Trend Filter: A 200-period EMA serves as the primary trend filter. If the close price is above this EMA, only long signals are considered. If below, only short signals are considered.
  • Momentum Oscillator: Standard MACD calculations (12, 26, 9) are used to detect momentum shifts.
  • Entry Logic: By requiring the MACD crossover to happen on the opposite side of the zero line (e.g., a bullish cross below zero), the indicator attempts to catch "mean reversion" moves within the primary trend direction.

Settings

  • Fast Length: The period for the fast Exponential Moving Average used in the MACD calculation.
  • Slow Length: The period for the slow Exponential Moving Average used in the MACD calculation.
  • Source: The price data used for calculations (typically set to Close).
  • Signal Smoothing: The period for the Signal line (an EMA of the MACD line).

FAQ

How do I use the MACD Crossover Trend Indicator?

To use the tool, look for "Buy" or "Sell" labels on your chart. A "Buy" label appears when momentum turns positive while price is in an uptrend, and a "Sell" label appears when momentum turns negative during a downtrend.

What are the best timeframes for this indicator?

While it can be applied to any timeframe, trend-following strategies using the 200 EMA are commonly applied to higher timeframes like the 1H, 4H, or Daily charts to reduce market noise.

How can 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.