Future MACD Indicator: Both Lines Extended Five Bars

Written by Dominic Walsh · Published · Last updated

The future macd indicator extends the two lines rather than price. It fits a straight line through the last `InpRegLookback` readings of the main line. The signal gets the same treatment. Both then draw `InpForecastBars` further right.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window (levels 0)
Plots 5: MACD, Signal, Histogram, Forecast MACD, Forecast Signal
Alerts popup, push notification, email, sound
Inputs 11

Chart elements

MACD is the gold main line and Signal is the dodger blue one.

Histogram is the silver series showing the gap between them.

Forecast MACD is the lime projection, Forecast Signal the red one.

A reference line marks zero.

  • MACD: line, gold, width 2
  • Signal: line, dodger blue, width 2
  • Histogram: histogram, silver, width 1
  • Forecast MACD: line, lime, width 2
  • Forecast Signal: line, red, width 2
Future MACD indicator on EURUSD H1 with both lines projected forward
Future MACD indicator on EURUSD H1 with both lines projected forward

What feeds each plot

The two real lines

iMACD supplies main and signal at `InpFastEMA` `12`, `InpSlowEMA` `26` and `InpSignalSMA` `9`. HistBuf takes the difference. Everything so far matches a standard build exactly.

Fitting a slope

The code fits a straight line to the last `InpRegLookback` `10` readings of each line. slopeM and slopeS come from that fit, with matching intercepts. Ten readings is a short window, so the slope reflects recent moves.

Projecting forward

Each forecast step evaluates the fitted line further along. Both projections start from the current value. So the lime and red lines join the real ones at the last candle rather than jumping.

How to read the signals

The projection shows where the current slope points, not where price goes.

A projected crossing means the two slopes would meet if nothing changed.

Both projections shift each bar as the fit updates.

Read the gap between the two forecast lines, not their level.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`InpEnableAlerts` is true out of the box. `InpEnablePopup` delivers the text. `InpEnablePush`, `InpEnableEmail` and `InpEnableSound` all begin false. `InpSoundFile` picks the clip. One message per closed bar.

Every Future MACD Indicator input

Core settings

Setting What it does Default
InpFastEMA Fast EMA period. Fast average length, default `12`. 12
InpSlowEMA Slow EMA period. Slow average length, default `26`. 26
InpSignalSMA Signal SMA period. Signal average length, default `9`. 9
InpForecastBars Forecast bars ahead. Bars the projection runs past the last candle, default `5`. 5
InpRegLookback Linear regression lookback. Readings the slope fit covers, default `10`. 10

Alert settings

Setting What it does Default
InpEnableAlerts Enable alerts on cross. Master switch for the forecast cross alerts, default `true`. on
InpEnablePopup Popup alert. Terminal dialog on a forecast cross, default `true`. on
InpEnablePush Push notification. Phone push on a forecast cross, default `false`. off
InpEnableEmail Email alert. Mail delivery on a forecast cross, default `false`. off
InpEnableSound Sound alert. Sound playback on a forecast cross, default `false`. off
InpSoundFile Sound file. Wav clip for the forecast alert, default `alert.wav`. alert.wav
Future MACD indicator inputs: InpFastEMA, InpSlowEMA, InpForecastBars, InpRegLookback
Future MACD indicator inputs: InpFastEMA, InpSlowEMA, InpForecastBars, InpRegLookback

Choosing a timeframe

A ten-reading slope fit describes the last stretch of movement. EURUSD H1 is the reference chart, where `InpRegLookback` at `10` covers under half a day. On M5 the projection swings around constantly. On H4 the fitted slopes hold steadier.

Where it lets you down

Extending a slope is arithmetic, not forecasting. Nothing is predicted here.

The projection redraws each bar, so a crossing shown yesterday may never happen.

Both lines already lag price, and projecting them does not fix that.

Copy the compiled Future MACD Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Future MACD Indicator for MT4 and MT5

The zip holds the compiled Future MACD Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

Is the Forecast MACD line a prediction?

No, and the name invites that misreading. It evaluates a straight-line fit at bars that have not happened. Change the slope and the whole projection moves. Treat it as a picture of the current tilt.

What does InpRegLookback at 10 fit?

The last ten readings of each line. A short window makes the slope reflect recent movement. Lengthening it steadies the projection, and it then reacts more slowly to a turn.

Why does InpForecastBars default to 5?

Because a longer projection looks impressive and adds nothing. Five bars is far enough to see where the slopes point. It is also short enough that the line still looks plausible.

Do the forecast lines join the real ones?

Yes. Each projection starts from the current value of its own line. So lime meets gold and red meets blue at the last candle. Without that step the projection would appear to jump.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Future MACD Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Also, truly, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment