MACD Crossover Trend Indicator
Jul 31, 2020

The MACD Crossover Trend indicator identifies trend-following entry points by combining MACD momentum crossovers with a long-term moving average filter. It aims to filter out counter-trend signals, ensuring that bullish entries only occur during uptrends and bearish entries only occur during downtrends.
Usage
The tool is designed to identify high-probability entries in alignment with the primary trend.
- Buy Signals: A "Buy" label appears when the price is trading above the 200 EMA (indicating an uptrend) and the MACD line crosses above the signal line while below the zero level.
- Sell Signals: A "Sell" label appears when the price is trading below the 200 EMA (indicating a downtrend) and the MACD line crosses below the signal line while above the zero level.
These signals can be used as entry points or as a confluence factor within a broader trading strategy. The indicator also supports alerts to notify users when a valid trend-aligned crossover occurs.
Details
The script utilizes a two-step validation process:
- Trend Detection: It uses a 200-period Exponential Moving Average (EMA). Prices above the EMA suggest a bullish regime, while prices below suggest a bearish regime.
- Momentum Filter: It calculates standard MACD components (Fast EMA, Slow EMA, and Signal line). For a bullish signal, the crossover must happen below the MACD zero line to catch potential mean-reversion or momentum shifts within the uptrend. Conversely, bearish crossovers must happen above the zero line.
Settings
- Fast Length: Sets the period for the faster EMA used in MACD calculation (default: 12).
- Slow Length: Sets the period for the slower EMA used in MACD calculation (default: 26).
- Source: Determines the price data used for the MACD calculations (default: Close).
- Signal Smoothing: Adjusts the EMA period applied to the MACD line to create the signal line (default: 9).
FAQ
How do I use the MACD Crossover Trend indicator?
The indicator is best used to find entries that align with the 200 EMA trend. Look for "Buy" labels during uptrends and "Sell" labels during downtrends.
Can I change the trend filter?
The current version uses a fixed 200 EMA for trend detection. You can adjust the MACD sensitivities via the settings menu to better fit different timeframes.
How can I access this indicator?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.