All indicators

EMA Cross + MACD Signal Cross overlay

Jan 24, 2019

Static chart image
Dynamic OverlaysSignalsOscillatorsMoving Averages

The EMA Cross + MACD Signal Cross overlay indicator provides a comprehensive trend-following toolkit by combining dual Exponential Moving Average (EMA) crossovers with MACD signal line analysis on the price chart. It aims to help traders identify trend shifts and momentum changes through a unified visual interface that includes chart markers, labels, and background highlights.

Usage

The indicator can be used to identify trend entries and exits by monitoring the interaction between price, moving averages, and momentum oscillators:

  • EMA Crossovers: When the fast EMA (default 8) crosses above the slow EMA (default 21), a green "x" appears on the EMA line and at the bottom of the chart, signaling a bullish trend shift. Conversely, a cross below signals a bearish shift with red markers.
  • MACD Signal Crosses: Crosses between the MACD line and its signal line are marked with an "x" at the top of the chart. These markers provide early warnings of momentum changes that may precede or confirm EMA crosses.
  • Trend Background: The chart background is dynamically colored based on the MACD relationship. A green background indicates the MACD line is above its signal line (bullish momentum), while a red background indicates it is below (bearish momentum).
  • Optional Overlay: Users can toggle the visibility of the MACD and Signal lines directly on the price chart to visualize the oscillator's behavior relative to price action.

Details

The script executes a dual-layered analysis:

  1. Trend Layer: Uses two EMAs to define the primary trend direction. The crossover method is a classic approach to identifying momentum-driven price movements.
  2. Momentum Layer: Implements the Moving Average Convergence Divergence (MACD) logic. The script allows for customization of the calculation method, offering the choice between Exponential Moving Averages (EMA) or Simple Moving Averages (SMA) for both the MACD oscillator and the signal line smoothing.

By combining these two methodologies, the indicator filters out minor price noise and provides a clearer picture of whether trend and momentum are aligned.

Settings

EMA Settings

  • EMA 1 Length: Determines the period for the fast Exponential Moving Average.
  • EMA 2 Length: Determines the period for the slow Exponential Moving Average.
  • EMA Source: The price data used for EMA calculations (default is Close).

MACD Settings

  • MACD Fast Length: The period for the shorter moving average in the MACD calculation.
  • MACD Slow Length: The period for the longer moving average in the MACD calculation.
  • MACD Source: The price data used for MACD calculations.
  • MACD Signal Smoothing: The lookback period for the signal line.
  • MACD Simple MA (Oscillator): If enabled, uses SMA instead of EMA for the fast/slow lines.
  • MACD Simple MA (Signal Line): If enabled, uses SMA instead of EMA for the signal line.
  • MACD Plot Graph Overlay: Toggles the visual plot of the MACD lines on the main chart.

FAQ

How do I use the MACD background color?

The background color provides an instant view of momentum. If the background is green, momentum is currently bullish; if red, it is bearish. This can be used to filter EMA cross signals.

Can I change the types of moving averages used?

Yes, within the settings menu, you can toggle between SMA and EMA for the MACD components to better suit your trading strategy.

How do I access EMA Cross + MACD Signal Cross overlay?

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.