ATR Bands Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Bollinger used standard deviation for the width of his envelope. The atr bands indicator uses range instead, which reacts differently to a gap or a long wick. It centres on a twenty-bar exponential average, sets both rails two ranges out, and marks a close that finishes beyond one.

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 5: Mid EMA, Upper, Lower, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 10

What the ATR Bands Indicator renders

A centre line, two rails and two marks.

`Mid EMA` traces silver at width 1.

`Upper` and `Lower` both trace royal blue at width 2.

`Buy` prints lime at width 3 using arrow 233.

`Sell` prints red at width 3 using arrow 234.

Marks stand `ArrowOffsetPoints` `30` clear of the bar.

  • Mid EMA: line, silver, width 1
  • Upper: line, royal blue, width 2
  • Lower: line, royal blue, width 2
  • Buy: arrow, lime, width 3, arrow code 233
  • Sell: arrow, red, width 3, arrow code 234
atr bands indicator: A close breaking the upper rail, EURUSD H1.
A close breaking the upper rail, EURUSD H1.

Behind the plots

The centre line

`EmaPeriod` `20` runs an exponential average of the close. Exponential weighting means the band as a whole follows a turn faster than a plain average would let it.

The width

`AtrPeriod` `20` gives the range figure and `Mult` `2.0` scales it. Both rails sit the same distance out, so the band is symmetric about its centre at every bar.

What earns a mark

The previous bar’s own rails are the reference. A close that was inside them and finishes beyond the current upper rail prints the buy mark.

Reading the output

A widening band means range is growing.

A narrowing band means it is shrinking.

Price riding a rail is normal in a trend.

The mark is a break outward, not a bounce.

Both rails move with the centre line.

Warm-up needs about forty bars.

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

A close finishing beyond a rail is the reported event. `EnableAlerts` decides whether it speaks and popup delivery is on already. Handset, mail and the speaker track named by `SoundFile` all begin closed, one message per closed bar.

Every ATR Bands Indicator input

Core settings

Setting What it does Default
EmaPeriod Window behind the centre line, `20`. 20
AtrPeriod Window behind the range figure, `20`. 20
Mult Ranges each rail sits from centre, `2.0`. 2.0

Display settings

Setting What it does Default
ArrowOffsetPoints Points a mark stands off the candle, `30`. 30

Alert settings

Setting What it does Default
EnableAlerts Whether a band break speaks, `true`. on
EnablePopup Popup delivery, on already, `true`. on
EnablePushNotify Handset delivery, `false`. off
EnableEmail Mail delivery, `false`. off
EnableSound Speaker delivery, `false`. off
SoundFile Track it plays, `”alert.wav”`. alert.wav
atr bands indicator: Inputs panel, the two periods above the multiplier.
Inputs panel, the two periods above the multiplier.

Picking a chart for it

Range-based width travels between symbols better than a standard-deviation band does. EURUSD H1 is the reference chart, where a close outside a rail comes perhaps twice a week. M15 produces many more. H4 makes each one worth looking at.

Where it falls down

A break outward can be the end of a move, not the start.

Range widens after a move, never before it.

Two ranges out is arbitrary, not derived.

Price can ride a rail for many bars without breaking it.

Copy the compiled ATR Bands 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 ATR Bands Indicator: Keltner channel on Wikipedia, Keltner Channel at Investopedia.

Download the ATR Bands Indicator for MT4 and MT5

The zip holds the compiled ATR Bands 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 the Mid EMA use exponential weighting?

So the whole band follows a turn promptly. A plain average would hold the centre back, which drags both rails with it and means price breaking out is partly just the band failing to keep up.

How does Mult 2.0 differ from a standard deviation band?

Range measures the size of bars including gaps between them; standard deviation measures the scatter of closes. A gap widens this band immediately, while a deviation band would barely notice it.

What must a close do to clear the Upper rail?

Sit inside the band on the previous bar, then finish above the current upper rail. That marks a break outward rather than a bounce off the rail, which would be the opposite reading entirely.

Does AtrPeriod 20 have to match EmaPeriod 20?

No, they are independent. Matching them keeps the band’s width and its centre responding on the same horizon, but you can run a fast centre with a slow width or the other way around.

Are results guaranteed?

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

Category: this is part of our Volatility collection. Thus, truly, 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