MACD and EMA200 With Signals
Oct 3, 2020

The MACD and EMA200 With Signals indicator combines trend-following filters with momentum crossovers to identify high-probability trade entries and potential false breakouts.
Usage
The indicator is designed to help traders differentiate between trend-aligned momentum and counter-trend movements. By using a 200-period Exponential Moving Average (EMA) as a trend filter, it classifies MACD histogram crossovers into four distinct categories:
- Bull Signal: Occurs when the MACD histogram crosses above zero while the price is trading above the 200 EMA, suggesting a trend-aligned long opportunity.
- Bear Signal: Occurs when the MACD histogram crosses below zero while the price is trading below the 200 EMA, suggesting a trend-aligned short opportunity.
- False Buy: Occurs when a bullish MACD crossover happens while the price is below the 200 EMA. This identifies momentum that is fighting the primary trend.
- False Short: Occurs when a bearish MACD crossover happens while the price is above the 200 EMA.
Details
The script calculates the standard Moving Average Convergence Divergence (MACD) components: the MACD line, the Signal line, and the Histogram. To filter these signals, it applies a 200-period EMA to the price source (close). The logic dictates that a momentum shift (histogram crossing the zero line) is only considered valid if it aligns with the location of the price relative to the long-term trend line. This implementation aims to reduce the number of "whipsaw" signals that often occur in ranging markets or during minor pullbacks against a strong trend.
Settings
MACD Settings
- Fast EMA Length: Determines the period for the shorter-term EMA used in the MACD calculation (default is 12).
- Slow EMA Length: Determines the period for the longer-term EMA used in the MACD calculation (default is 26).
- Signal Length: Determines the smoothing period for the MACD Signal line (default is 9).
Trend Settings
- Trend Length: Sets the period for the trend-filtering EMA, which distinguishes between "Bull/Bear" and "False" signals (default is 200).
FAQ
How do I interpret the "False" signals?
False signals indicate that momentum is shifting against the long-term trend. While these can sometimes precede a trend reversal, they are often used by traders as a warning to avoid entries or to tighten stop losses on existing positions.
Can I use this for scalping?
Yes, by adjusting the Fast, Slow, and Trend lengths to lower values, the indicator can be adapted for shorter timeframes, though the default 200 EMA is typically optimized for identifying major trend directions.
How do 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.