Bollinger Trend Indicator: Two Band Sets, One Column

Written by Dominic Walsh · Published · Last updated

The bollinger trend indicator compares two Bollinger sets instead of one. A short set runs at `InpShortPeriod` `20` and a long set at `InpLongPeriod` `50`. The gap between their edges becomes a single column in the pane.

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
Plots 5: BBTrend, Zero, Signal, Up, Down
Alerts popup, push notification, email, sound
Inputs 13

What appears on the chart

The pane carries one column series called BBTrend.

A flat Zero line marks the crossing level.

An orange Signal line smooths the column at `InpSignalPeriod` `5`.

`InpDrawArrows` adds up and down marks where the column crosses zero.

  • BBTrend: histogram, dodger blue, width 2
  • Zero: line, silver, width 1
  • Signal: line, orange, width 1
  • Up: arrow, lime, width 2, arrow code 233
  • Down: arrow, red, width 2, arrow code 234
Bollinger trend indicator column, signal line and zero-cross arrows on EURUSD H1.
Bollinger trend indicator column, signal line and zero-cross arrows on EURUSD H1.

From bar to value

Two Bollinger sets, same price

iMA and iStdDev build both sets. `InpShortDev` `2.0` and `InpLongDev` `2.0` set how far each pair of edges sits from its own middle band.

The gap becomes a percentage

The code takes the distance between the two lower edges, subtracts the distance between the two upper edges, divides by the short middle band and multiplies by a hundred. A percentage travels between instruments. A raw price gap does not.

Zero is the pivot

A positive column says the lower edges spread wider than the upper ones. A negative column says the reverse. Crossing zero flips that reading, which is where the arrows land.

How to use what it draws

Column height shows how lopsided the two band sets are.

The orange line lags the column by design at `InpSignalPeriod` `5`.

`InpArrowOffset` `0.0` puts the marks right on the zero line.

A long stretch on one side of zero means the short set kept drifting one way.

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

`EnableAlerts` starts true and `EnablePopup` carries the terminal message. Set `EnablePushNotify` for a phone alert, `EnableEmail` for mail or `EnableSound` to play `SoundFile`. All three of those begin false. Crossings are read on closed bars only.

Every Bollinger trend Indicator input

Core settings

Setting What it does Default
InpShortPeriod Short Bollinger length. Bars in the short Bollinger set, default `20`. 20
InpLongPeriod Long Bollinger length. Bars in the long Bollinger set, default `50`. 50
InpShortDev Short BB deviation. Edge distance for the short set, in deviations, default `2.0`. 2.0
InpLongDev Long BB deviation. Edge distance for the long set, in deviations, default `2.0`. 2.0
InpSignalPeriod Signal smoothing (SMA of BBTrend). Bars in the average drawn over the column, default `5`. 5

Display settings

Setting What it does Default
InpDrawArrows Draw zero-cross arrows. Mark the zero crossings, default `true`. on
InpArrowOffset Arrow Y offset (0 = at zero line). Height of a mark above or below zero, default `0.0`. 0.0

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Bollinger trend indicator inputs panel with InpShortPeriod, InpLongPeriod and InpSignalPeriod.
Bollinger trend indicator inputs panel with InpShortPeriod, InpLongPeriod and InpSignalPeriod.

Choosing a market

A fifty-bar band set needs history behind it. EURUSD H1 is the reference chart, where `InpLongPeriod` `50` covers two days. On M15 the column reacts quickly and crosses often. Daily bars give a slow, broad reading instead.

Where care is needed

Two crossings can land within a few bars when the column hovers near zero.

Dividing by the short middle band means a low-priced instrument scales differently.

The reading describes band geometry, not the direction of price on its own.

Copy the compiled Bollinger trend 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.

Background reading on the method behind the Bollinger trend Indicator: Swing trading on Wikipedia, Pennant at Investopedia.

Download the Bollinger trend Indicator for MT4 and MT5

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

What does InpShortPeriod 20 set?

Bars in the faster Bollinger set. Twenty against the fifty in `InpLongPeriod` is what creates the gap the column plots. Bring the two closer together and the column flattens, because both sets then describe nearly the same stretch of price.

Why does BBTrend divide by the middle band?

To turn a price distance into a percentage. Raw distances mean different things on a 1.10 currency pair and a 40,000 index. Dividing by the short middle band puts every instrument on one scale, which is why the pane needs no per-symbol tuning.

What does InpSignalPeriod 5 smooth?

The column series itself, not price. A five-bar average over BBTrend gives the orange line, so a crossing between the two says the column turned against its own recent average. Lengthen it for a calmer line that confirms later.

Where does InpArrowOffset 0.0 place a mark?

Directly on the zero line, which is where the crossing happens. Raise it and the marks lift clear of the column tops, useful when the histogram is tall. The value works in the same units the column uses.

Are results guaranteed?

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

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