MACD Crossover Strategy with EMA200 Trend Detection
Jan 21, 2021

The MACD Crossover Strategy with EMA200 Trend Detection tool provides a rule-based approach to trend-following entries by combining standard MACD momentum crossovers with a long-term Exponential Moving Average filter.
Usage
This strategy is designed to identify momentum shifts that align with the prevailing long-term trend. Users can look for visual shapes on the chart to identify potential entries:
- Bullish Signals: A green triangle appears when the MACD line crosses above the signal line below the zero level, provided the price is trading above the 200 EMA.
- Bearish Signals: A red triangle appears when the MACD line crosses below the signal line above the zero level, provided the price is trading below the 200 EMA.
The indicator is most effective in trending markets where the 200 EMA acts as a clear baseline for directional bias.
Details
The script utilizes the standard Moving Average Convergence Divergence (MACD) calculation, typically using 12 and 26 periods. It adds an extra layer of confluence by requiring crossovers to occur on a specific side of the zero line—bullish crosses must occur below zero (mean reversion toward the trend) and bearish crosses must occur above zero. The 200-period EMA serves as a filter to ensure trades are only taken in the direction of the primary trend, reducing the frequency of false signals in counter-trend scenarios.
Settings
- Fast moving average: Determines the length of the shorter EMA used in the MACD calculation (Default: 12).
- Slow moving average: Determines the length of the longer EMA used in the MACD calculation (Default: 26).
- Signal Length: The smoothing period for the MACD signal line (Default: 9).
- Trend Indicator EMA: The period used for the trend-filtering Exponential Moving Average (Default: 200).
FAQ
How do I use the signals for entries?
Signals are displayed as triangles above or below the price bars. A triangle up suggests a bullish entry in an uptrend, while a triangle down suggests a bearish entry in a downtrend.
Can I change the trend filter sensitivity?
Yes, by adjusting the "Trend Indicator EMA" setting, you can make the trend filter more responsive (lower value) or more conservative (higher value).
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.