All indicators

Predictive MACD

May 19, 2022

Static chart image
SignalsForecastingOscillatorsMoving Averages

The Predictive MACD indicator projects the potential trajectory of the MACD line, signal line, and histogram for the next three bars based on current momentum and price action. By simulating future values, this tool helps traders anticipate potential crossovers and trend shifts before they occur on the price chart.

Usage

The Usage section describes how the script can be used, examples should be provided in this section. This section also focuses on how main settings affect the indicator interpretation and output.

  • Trend Anticipation: Traders can observe the projected circles (MACD and Signal) and histograms to see if a bullish or bearish crossover is likely in the next three candles.
  • Momentum Analysis: If the predicted histogram bars continue to grow in the direction of the current trend, it suggests strong momentum. Conversely, if the predicted bars begin to shrink, it may signal an upcoming reversal or consolidation.
  • Price Scenarios: The tool calculates these projections by assuming current price dynamics persist. It provides a visual guide for "what-if" scenarios, allowing traders to set more effective entry or exit points based on the expected curvature of the MACD lines.

Details

The script is based on the traditional Moving Average Convergence Divergence (MACD) formula but extends its functionality through a recursive calculation function.

  1. Core Calculation: It calculates the standard MACD (Fast EMA - Slow EMA) and its Signal line (EMA of the MACD).
  2. Projection Logic: The script uses a custom function calF to perform forward-looking calculations. It treats the current EMA values as the "previous" values for the next step, effectively iterating the EMA formula three times into the future.
  3. Visualization: The projected values are plotted using an offset (1, 2, and 3 bars forward). These are displayed as circles for the lines and small histogram bars to distinguish them from historical data.

Settings

  • Fast Length: The lookback period for the shorter Exponential Moving Average (default is 5).
  • Slow Length: The lookback period for the longer Exponential Moving Average (default is 34).
  • Source: The price data used for calculations, typically set to "Close".
  • Signal Smoothing: The EMA period used to smooth the MACD line into the Signal line.
  • Percentage Price: When enabled, calculates the MACD as a percentage of the slow EMA rather than using absolute points.
  • Color Settings: Allows customization of the MACD line, Signal line, and the four distinct histogram states (Growing/Falling Above Zero, Growing/Falling Below Zero).

FAQ

How do I interpret the circles on the chart? The circles represent the predicted values for the MACD and Signal lines for the next three bars. If the circles for the MACD line are moving toward the Signal line, a crossover may be imminent.

Is the prediction guaranteed to happen? No, the prediction is a mathematical projection based on current data. If the price moves significantly in the opposite direction of the current trend, the actual MACD values will deviate from the projected circles.

How can I access the Predictive MACD? 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.