PZ Bollinger Trend Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Bollinger Bands show range; a trend line inside them shows direction. The PZ Bollinger trend indicator draws 50-bar bands at two deviations and smooths their basis again with an exponential average. That smoothed line turns green or red depending on its slope and where price closes, and each change gets a mark.

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 Main price chart
Plots 6: BB Upper, BB Lower, Trend Up, Trend Dn, BUY, SELL
Alerts popup, push notification, email, sound
Inputs 10

The plots and where they sit

Two bands, a two-colour line and marks.

Silver `BB Upper` and `BB Lower` lines frame price.

`Trend Up` draws lime at width 3.

`Trend Dn` draws red at width 3.

`BUY` flags a flip up in lime.

`SELL` flags a flip down in red.

  • BB Upper: line, silver, width 1
  • BB Lower: line, silver, width 1
  • Trend Up: line, lime, width 3
  • Trend Dn: line, red, width 3
  • BUY: arrow, lime, width 2, arrow code 233
  • SELL: arrow, red, width 2, arrow code 234
pz bollinger trend indicator: Bollinger trend line with flip marks, EURUSD H1.
Bollinger trend line with flip marks, EURUSD H1.

How the calculation works

The bands

`InpBBPeriod` `50` sets a simple average and standard deviation. `InpBBDeviation` `2.0` places the bands.

The trend line

`InpMAMethod` `MODE_EMA` smooths the 50-bar basis again. That line is the one that turns green or red.

The flip

Green needs a close above the line, a rising line, and a close above the lower band. Red mirrors this, and each change of state earns a mark.

How to read it

Green means price leads a rising basis.

Red means price trails a falling basis.

No colour means the two rules disagree.

Marks show the first bar of a new state.

At least three bars separate any two marks.

Warm-up needs about fifty bars.

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

A flip of the trend line sends one message naming the new side. `EnableAlerts` lets it through, with the popup as the single route enabled from the start.

Every PZ Bollinger Trend Indicator input

Core settings

Setting What it does Default
InpBBPeriod Bollinger period (basis = SMA). Length behind bands and basis, `50`. 50
InpBBDeviation Bollinger std-dev multiplier. Distance of each band from the basis, `2.0`. 2.0
InpMAMethod Smoothing for trend basis (0 SMA, 1 EMA, 2 SMMA, 3 LWMA). Extra smoothing on the basis, `MODE_EMA`. MODE_EMA

Display settings

Setting What it does Default
InpArrowOffsetPts Arrow offset from candle (points). Mark gap in points, `12`. 12

Alert settings

Setting What it does Default
EnableAlerts Switch for flip messages, `true`. on
EnablePopup Popup, `true`. on
EnablePushNotify Mobile route, `false`. off
EnableEmail Email route, `false`. off
EnableSound Speaker, `false`. off
SoundFile Speaker clip, `”alert.wav”`. alert.wav
pz bollinger trend indicator: Inputs panel, band settings above the smoothing.
Inputs panel, band settings above the smoothing.

Where it earns its keep

A 50-bar basis suits trending charts. EURUSD H1 is the reference chart, with a flip every few days. On M15 it tracks the session trend. On D1 each flip marks a change in the larger swing.

The trade-offs

A 50-bar basis reacts slowly.

Flat slopes cause flicker at the line.

Bands play no part in most flips.

Messages reach you by popup alone at first.

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

Download the PZ Bollinger Trend Indicator for MT4 and MT5

The zip holds the compiled PZ 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 three things switch Trend Up on?

A close above the smoothed basis, a basis that is rising or flat, and a close above the lower band. The build checks all three together on each closed bar.

Why smooth the basis with InpMAMethod MODE_EMA?

The plain 50-bar average steps sharply when old bars drop out. A second, exponential pass gives a steadier line whose slope is easier to trust.

What does InpBBDeviation 2.0 change?

Only the band width. The bands frame the trend line and add a small check, but the colour mostly depends on the smoothed basis and its slope.

Why do Trend Up and Trend Dn both go blank?

When price sits on one side of the basis but the slope points the other way, neither rule holds. The build then leaves the line blank until the two agree again.

Are results guaranteed?

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

Category: this is part of our Trend collection. 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