Bollinger Bands MACD Indicator: Bands Around The Line

Written by Dominic Walsh · Published · Last updated

The bollinger bands macd indicator puts an envelope around the MACD main line. MACD has no natural bounds, so judging a reading as high or low is normally guesswork. A band built from the line’s own recent behaviour turns that judgement into a measurement.

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 4: MACD, Signal, MACD BB Upper, MACD BB Lower
Alerts popup, push notification, email, sound
Inputs 11

What the Bollinger Bands MACD Indicator draws on the chart

MACD is the dodger blue line and Signal is the orange one.

MACD BB Upper is the medium sea green line above them.

MACD BB Lower is the tomato line below.

A single reference line marks zero.

  • MACD: line, dodger blue, width 2
  • Signal: line, orange, width 1
  • MACD BB Upper: line, medium sea green, width 1
  • MACD BB Lower: line, tomato, width 1
Bollinger bands MACD indicator on EURUSD H1 with the line riding its own envelope
Bollinger bands MACD indicator on EURUSD H1 with the line riding its own envelope

How the Bollinger Bands MACD Indicator calculates its values

Taking MACD first

iMACD supplies the main and signal lines at `FastMacd` `12`, `SlowMacd` `26` and `SignalMacd` `9`. Both go into plotted buffers, and the main line also goes into a working series that the band step reads back.

Wrapping the envelope

mean averages the last `BbPeriod` `20` MACD values. sd measures how far they scattered around it. BbUp then adds `BbMult` `2.0` times sd and BbLo subtracts it. Warmup covers the slow period plus the band period plus three bars.

Why this differs from a histogram

The MACD histogram measures the gap between the two lines. This band measures how far the main line has strayed from its own average. A wide histogram and a band touch are different events, and they often happen at different times.

How to read the signals

MACD outside its own band is stretched by its own recent standards.

Narrow bands mean the line has been steady, whatever level it sits at.

A band drifting away from zero shows the whole reading has shifted with the trend.

Compare a band touch against where the signal line sits.

Alert channels in this build: popup, push notification, email and sound.

`EnableAlerts` ships enabled, with `EnablePopup` handling delivery. `EnablePushNotify`, `EnableEmail` and `EnableSound` all start false. `SoundFile` picks the clip. This build has no once-per-bar guard, so keep the noisier channels off unless repeats suit you.

Every Bollinger Bands MACD Indicator input

Core settings

Setting What it does Default
FastMacd Fast average inside MACD, default `12`. 12
SlowMacd Slow average inside MACD, default `26`. 26
SignalMacd Signal average, default `9`. 9
BbPeriod MACD values in the band average, default `20`. 20
BbMult Band width in deviations of the line, default `2.0`. 2.0

Alert settings

Setting What it does Default
EnableAlerts Master switch for the envelope alerts, default `true`. on
EnablePopup Terminal dialog on an envelope event, default `true`. on
EnablePushNotify Phone push on an envelope event, default `false`. off
EnableEmail Mail delivery on an envelope event, default `false`. off
EnableSound Sound playback on an envelope event, default `false`. off
SoundFile Wav clip for the envelope alert, default `alert.wav`. alert.wav
Bollinger bands MACD indicator inputs: FastMacd, SlowMacd, SignalMacd, BbPeriod, BbMult
Bollinger bands MACD indicator inputs: FastMacd, SlowMacd, SignalMacd, BbPeriod, BbMult

Settings that fit your chart

MACD values scale with price, so the band travels between instruments better than the raw line does. EURUSD H1 is the reference chart, where the envelope reacts within a day. On M5 the band widens and narrows quickly. On H4 it settles and a touch becomes a much rarer event.

When the Bollinger Bands MACD Indicator fails

Two layers of averaging sit between price and the band, so it reacts late.

A strong trend drags the whole envelope with it, which hides the stretch you were looking for.

MACD values depend on the instrument price, so the band numbers mean nothing across charts.

Copy the compiled Bollinger Bands 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 Bollinger Bands MACD Indicator for MT4 and MT5

The zip holds the compiled Bollinger Bands 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

Does BbPeriod read MACD or price?

Twenty MACD readings, not twenty closes. The band step treats the main line as its input series. So the envelope describes how the MACD line has behaved recently rather than how price has behaved.

How is this different from the MACD histogram?

The histogram measures the gap between the main line and the signal. This band measures how far the main line has drifted from its own average. The two answer different questions and often peak at different times.

Why does the MACD plot need an envelope?

Because MACD has no fixed bounds. A reading of 0.0015 means nothing until you know what that line usually does on this chart. `BbMult` `2.0` turns that into a measurement rather than a guess.

Should SlowMacd stay at 26?

It keeps the reading comparable with every other MACD you have seen, which is worth something. Changing it moves the whole line and the band with it. Adjust `BbPeriod` first if you want a different feel from the envelope.

Are results guaranteed?

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

Authoritative references

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.

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