Average Daily Range Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The average daily range indicator puts two figures side by side in pips. A purple line holds the fourteen-day average. Silver columns show how far today has travelled so far. When the columns reach the line, the session has already done a normal day of work.

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

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window
Plots 2: ADR (pips, avg of last N days), Day so-far range (pips)
Alerts popup, push notification, email, sound
Inputs 7

What you see once it loads

One line and one histogram, in a pane.

`ADR (pips, avg of last N days)` runs medium purple.

`Day so-far range (pips)` fills silver columns.

Both are scaled to pips, not price.

The scale starts at zero.

Digits get handled, so five-digit quotes read correctly.

  • ADR (pips, avg of last N days): line, medium purple, width 2
  • Day so-far range (pips): histogram, silver, width 2
average daily range indicator: The average line and today's column on XAUUSD H1.
The average line and today’s column on XAUUSD H1.

The logic, one stage at a time

Grouping by day

It walks the bars in order. Each change of day closes off a high and a low. Those pairs give one range figure per completed day.

The average

Fourteen days feed it. `AdrDays` `14` sets the count, and the mean of those ranges becomes the purple line. It only moves when a day completes.

Today so far

The columns track the running session. Highest high minus lowest low since the day began, converted to pips. Each new day resets the column to zero.

Making sense of the output

Short columns early in the session mean room remains.

Columns level with the line mean a normal day is done.

Columns well past the line mark an outsized session.

The line barely moves, so treat it as the yardstick.

A rising line means recent days have been getting bigger.

Both figures read in pips, so they compare directly.

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

`EnableAlerts` sits over the tool’s messages and starts true with `EnablePopup`. Use `EnablePushNotify` for a phone, `EnableEmail` for mail, or `EnableSound` to play `SoundFile`. Those three begin off.

Every Average Daily Range Indicator input

Core settings

Setting What it does Default
AdrDays Completed days in the average, `14`. 14

Alert settings

Setting What it does Default
EnableAlerts Master switch, `true`. on
EnablePopup Box in the terminal, `true`. on
EnablePushNotify Buzz on a phone, `false`. off
EnableEmail Mail from the tool, `false`. off
EnableSound Audio cue, `false`. off
SoundFile Which clip plays, `”alert.wav”`. alert.wav
average daily range indicator: Inputs panel with AdrDays and the alert routes.
Inputs panel with AdrDays and the alert routes.

Symbols and timeframes

XAUUSD H1 is the reference chart, because gold expands and contracts visibly. The columns there swing from half the line to double it. On EURUSD the two sit closer together. On daily bars each column is one candle wide.

Known limits

Fourteen days of history says nothing about today.

A holiday week drags the average down.

The columns keep growing and never come back down within a day.

Pip conversion assumes a standard quote format.

Copy the compiled Average Daily Range 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: Range Trading Strategy.

Background reading on the method behind the Average Daily Range Indicator: Average True Range at BabyPips, Average True Range ATR at StockCharts ChartSchool.

Download the Average Daily Range Indicator for MT4 and MT5

The zip holds the compiled Average Daily Range 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 AdrDays 14 use fourteen days?

Fourteen completed sessions is roughly three trading weeks, long enough to smooth one unusual day and short enough to track a change in conditions. Raising it makes the purple line steadier and slower to notice a shift.

When does the Day so-far range plot reset?

At each new day. The column measures the highest high minus the lowest low since the session began, so it starts at zero every day and only ever grows until the date changes.

Why are both plots shown in pips?

So they compare directly and mean the same thing on any symbol. The code checks the digit count and scales accordingly, which is why a five-digit quote reads the same as a four-digit one.

Can the columns pass the ADR line?

Often, and it is worth watching for. A column above the line says today has already travelled more than a typical recent day, which usually means news or a session with unusual interest behind it.

Are results guaranteed?

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

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