MACD including 6-period Forecast and Divergences
Feb 3, 2021

The MACD including 6-period Forecast and Divergences indicator enhances the standard MACD by providing a 6-period forward-looking projection and automated divergence detection. It aims to give traders an outlook on potential future trend shifts and momentum exhaustion through integrated forecasting logic and visual divergence cues.
Usage
This tool can be used to identify upcoming momentum shifts before they occur. The forecast lines provide a visual estimation of where the MACD, Signal, and Histogram might be in the next six periods based on current price action. Traders can use this to anticipate histogram crossovers or zero-line rejections.
The divergence detection feature highlights discrepancies between price action and momentum, which often precede trend reversals. Users can toggle between detecting divergences on the Histogram or the MACD line itself to suit their strategy.
Details
The forecasting logic is built upon EMA projections. It offers two primary calculation modes:
- Flat: Assumes future prices remain equal to the most recent closing price.
- Linear Regression: Projects future prices based on a linear regression of a user-defined lookback period.
Additionally, the forecast can be adjusted with a "Bias" setting. This uses the Average True Range (ATR) to shift the forecast in a more bullish or bearish direction, allowing users to account for prevailing market volatility or personal market sentiment.
Note: Forecasted values are based on the current candle's closing price and will update in real-time as price fluctuates, effectively recalculating the "outlook" until the candle closes.
Settings
Forecast Settings
- Show Forecast: Toggles the visibility of the 6-period forecast plots.
- MA Forecast Type: Choose between "Flat" (constant price) or "Linreg" (trend-based projection).
- Linreg Length: The number of candles used to calculate the linear regression slope.
- Forecast Bias: Adjusts the forecast output to be Neutral, Bullish, or Bearish.
- Forecast Bias - ATR Periods: The lookback period for calculating the ATR used in the bias adjustment.
- Forecast Bias - Multiplier: Scales the impact of the ATR-based bias on the forecast.
Divergence Settings
- Show Divergences: Enables or disables automated divergence detection.
- Divergence Source: Select whether to detect divergences on the Histogram or the MACD Line.
- Source Type: Choose whether to use price Wicks or Candle Bodies for price comparisons.
- Pivot Lookback Right/Left: Sets the number of bars required to confirm a pivot high or low.
- Lookback Range (Min/Max): Defines the distance between peaks/troughs to be considered for a divergence.
FAQ
How do I access MACD including 6-period Forecast and Divergences?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why do the forecast lines move during an active candle?
The forecast uses the current price as a basis for its projection. As the current price changes, the projected path for the next 6 periods is recalculated to reflect the most recent data.
Can I use this for automated trading signals?
While the indicator provides divergences and forecasts, it is designed as an analytical tool to provide an "outlook" rather than a standalone signal generator. Users should combine these insights with other technical analysis methods.
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.