Bollinger Band Breakout Alert Indicator: A Band Close

Written by Dominic Walsh · Published · Last updated

The bollinger band breakout alert indicator watches for one event. A close outside the band, on a bar whose predecessor closed inside it. That two-bar test is what separates a breakout from a bar that was already outside.

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

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 5: Mid, Upper, Lower, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 9

Drawn output, plot by plot

A goldenrod `Mid` line runs at `BbPeriod` `20`.

Dodger blue `Upper` and `Lower` lines sit `BbMult` `2.0` deviations away.

`Buy` marks the upside break with arrow 233 and `Sell` marks the downside with 234.

Marks sit `ArrowOffsetPts` `30` points from the candle.

  • Mid: line, goldenrod, width 2
  • Upper: line, dodger blue, width 2
  • Lower: line, dodger blue, width 2
  • Buy: arrow, lime, width 3, arrow code 233
  • Sell: arrow, red, width 3, arrow code 234
Bollinger band breakout alert indicator bands and break arrows on the GBPUSD M15 chart.
Bollinger band breakout alert indicator bands and break arrows on the GBPUSD M15 chart.

What happens on each bar

Standard band construction

iMA gives the middle line as a simple average of the close. iStdDev gives the spread over the same window. Adding and subtracting `BbMult` `2.0` of that spread produces the two edges.

The two-bar rule

A buy needs this close above the upper edge while the previous close sat at or below it. Without that second half, every bar of a strong run outside the band would earn its own mark.

The edges move with the close

Both edges are recomputed each bar, so the level a close must beat is never the same twice. A break during a squeeze needs far less movement than one after a wide stretch.

Using it on a chart

A narrow band means quiet conditions, and breaks there need little movement.

A wide band means the opposite, so a break carries more weight.

The middle line is the average the whole construction hangs from.

Marks appear only on the first bar outside, never on the ones after.

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

`EnableAlerts` heads four routes and ships true beside `EnablePopup`. Use `EnablePushNotify` for a handset, `EnableEmail` for mail, and `EnableSound` to sound `SoundFile`. Those three start off. A break reports once, on the closing bar.

Every Bollinger band breakout alert Indicator input

Core settings

Setting What it does Default
BbPeriod Bars in the average and the spread, default `20`. 20
BbMult Deviations between the middle line and each edge, default `2.0`. 2.0

Display settings

Setting What it does Default
ArrowOffsetPts Points between a mark and the candle, default `30`. 30

Alert settings

Setting What it does Default
EnableAlerts Head switch for the four routes, default `true`. on
EnablePopup Box in the terminal, default `true`. on
EnablePushNotify Route to a phone, default `false`. off
EnableEmail Route to mail, default `false`. off
EnableSound Route to a clip, default `false`. off
SoundFile Name of that clip, default `”alert.wav”`. alert.wav
Bollinger band breakout alert indicator inputs panel with BbPeriod and BbMult.
Bollinger band breakout alert indicator inputs panel with BbPeriod and BbMult.

Choosing a market

The screenshot note picks GBPUSD M15 for clean channel breaks. EURUSD H1 gives a slower version, with a break every few days. Higher timeframes turn each break into a rarer and larger event.

When it will mislead you

A close outside a two-deviation band is common, so breaks are frequent.

The band widens after a break, which makes the next one harder to trigger.

Nothing here distinguishes a breakout from an overextension.

Copy the compiled Bollinger band breakout alert 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.

Related on forexmt4systems.com: Bollinger Bands Mean Reversion Strategy for AUDUSD on H4.

Background reading on the method behind the Bollinger band breakout alert Indicator: Trading band on Wikipedia, Bollinger Bands at StockCharts ChartSchool.

Download the Bollinger band breakout alert Indicator for MT4 and MT5

The zip holds the compiled Bollinger band breakout alert 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

Why does BbMult 2.0 matter so much?

It sets how far the edges sit from the middle line. Two deviations covers most bars in a normal distribution, so closes outside are meaningful but not rare. Widening it to three makes breaks unusual events.

What does BbPeriod compare across two bars?

A stream of marks during a strong run. Once price is outside the band it often stays there. Requiring the previous close to be inside means only the bar that crossed gets a mark.

Does BbPeriod 20 use a simple average?

Yes. Both the middle line and the spread come from a simple average over twenty bars, which is how Bollinger defined it. Some builds substitute an exponential average, and this one does not.

Why do the band edges move every bar?

Because the spread is recalculated on each new close. In a quiet stretch the edges tighten and a small move can break out. After a large move they widen, so the next break needs far more.

Are results guaranteed?

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

Category: this is part of our Volatility collection. Also, yet, browse more Volatility 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