MT5 indicators← Average Daily Range product page日本語の取扱説明書

This product is in preparation for release. Product files are not yet distributed; the manual is published so that you can review its content. This manual is an English translation of the Japanese manual. Images (screens and figures) are not translated and may contain Japanese text or earlier names.

For Trilogy users

Average Daily Range

Compares today's high − low with average daily ranges for up to 5 periods in a table in pips.

Indicator name: Average Daily RangeMetaTrader 5Shown in a corner of the price chart

Read today's range separately from the average of closed daily bars

High − low of 1 dayClosed daily bars averaged for each periodHighLowA “range” separate from up or down directionToday5-Day Avg20-Day Avg427675Example values; the unit is pips
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Look at TodayThe high − low of the latest daily bar. For a day in progress, it is the range up to that point.

2

Look at the period rowsAverages of closed daily bars, not including today. By default, Saturday and Sunday bars are excluded.

3

Check the unit and “−”Values are whole pips. “−” shows that there are not enough closed daily bars to calculate that period.

High − lowUp to 5 periodsNot a forecast or a remaining range
1

MT5 display and examples of changed settings

Compares the default settings and a settings change example on a screen with only this product applied.

Settings change example: these items are changed
Period 1
InpDays1
1 → 3
Period 2
InpDays2
5 → 7
Period 3
InpDays3
10 → 0
Period 4
InpDays4
20 → 69
Period 5
InpDays5
60 → 70
Show today row
InpShowToday
true → false
Exclude weekend daily bars from averages
InpSkipWeekend
true → false
Table corner
InpCorner
Bottom left → Bottom right
Horizontal position
InpXOffset
10 → 15
Vertical position
InpYOffset
20 → 30
Font size
InpFontSize
11 → 14
Heading and label color
InpLabelColor
Chocolate → DarkGreen
Value color
InpValueColor
SlateGray → MediumBlue

All other inputs remain at their defaults. On a PC, the default is on the left and the change example on the right; at smartphone width they appear in the same order from top to bottom.

Default settingsInpDays1 = 1 / InpDays2 = 5 / InpDays3 = 10 / InpDays4 = 20 / InpDays5 = 60 / InpShowToday = true / InpSkipWeekend = true / InpCorner = Bottom left / InpXOffset = 10 / InpYOffset = 20 / InpFontSize = 11 / InpLabelColor = Chocolate / InpValueColor = SlateGray
Average Daily Range default settings
Default display at the lower left. Shows Today and 1, 5, 10, 20 and 60 days. Prev Day is 121 pips.
View the screen in detail at full size
Average Daily Range default settings (full size)
Settings change exampleInpDays1 = 3 / InpDays2 = 7 / InpDays3 = 0 / InpDays4 = 69 / InpDays5 = 70 / InpShowToday = false / InpSkipWeekend = false / InpCorner = Bottom right / InpXOffset = 15 / InpYOffset = 30 / InpFontSize = 14 / InpLabelColor = DarkGreen / InpValueColor = MediumBlue
Average Daily Range settings change example
An example in the bottom right with changed periods, weekend handling, display position and text. The “-” for 70-Day Avg indicates insufficient history. The two images also have different vertical axis ranges, so compare the table contents, not the apparent height of the price.
View the screen in detail at full size
Average Daily Range settings change example (full size)

Example shown: 15-minute chart (M15). This is an example to explain the display. The settings change example is not a recommended value. Details can be checked in the full-size view.

2

How to read it in 30 seconds

The unit is pips

Values are listed under the heading Daily High-Low (pips). They are not raw point values.

Keep Today and the averages separate

Today is calculated from the latest daily bar; the period rows are calculated from closed daily bars, excluding today.

Exceeding the average is not a ceiling

Even if today's range exceeds the average, that does not mean the price will not move further.

3

What it measures

Averages the high − low of each daily bar. The calculation differs from the True Range, which includes the previous day's close, and from ATR, its average.

Daily high − low

Uses the difference between the highest and lowest prices within the daily bar. A part that opened away from the previous day's close is not added.

Only closed daily bars are averaged

An n-day average uses the n most recent bars, excluding today. By default, weekend daily bars are skipped when counting, so it is not necessarily n calendar days.

Difference from Daily Info Panel

The 5D Avg Range of Daily Info Panel uses the true range, which includes the previous day's close, and does not exclude weekends. Even for the same number of days, its values may differ from this product's.

Display in whole pips

Price differences are rounded to points, the average in pips is calculated from the total, and it is rounded to the nearest whole number. Exact halves are rounded up.

4

Situations for reading the display

Compare today with past averages

Indicator
Look at Today and rows such as 5-Day Avg.
Cross-check
Check the difference: today is in progress, while the averages use closed daily bars.
Check
Compare only the size of the range, in the same unit.
Caution
Do not read the difference from the average as a remaining range or a price target.

Compare short-term and long-term ranges

Indicator
Look at several averages, such as 5, 20 and 60 days.
Cross-check
Check that the setting for including weekends is the same.
Check
Compare in which periods the range was larger.
Caution
The range does not show the up or down direction of the price.

70-Day Avg shows “-”

Indicator
Look at the row that shows a hyphen instead of a number.
Cross-check
Check whether the closed daily bars needed for the period are loaded.
Check
Wait for the history to load, or choose a shorter period that suits your purpose.
Caution
“-” does not mean a range of 0.

Does not match other range displays

Indicator
Check this product's high − low and the definition used by the other display.
Cross-check
Cross-check true range, weekend exclusion, number of days and pips conversion.
Check
Compare only figures with the same conditions and definitions.
Caution
Having Range in the name does not necessarily mean the same calculation.
5

Steps for checking the display

1

Check the default table

Attach 1 instance of this product to 1 chart and find the table in the bottom left. Check the heading, Today and the period rows.

2

Check the unit and periods

For non-FX symbols, check whether the automatic Pip Size conversion suits your purpose. Also check the periods and weekend exclusion.

3

Choose only the rows you need

Change Period 1 to 5. Setting an unneeded period to 0 removes that row.

4

Move it to a readable position

If the table overlaps the price bars, adjust Corner, the position and the font size.

6

Installation and checking the package contents

Included filePurpose / location
TRI_Average_Daily_Range.ex5The MT5 main file. Place it in MQL5/Indicators.

The ZIP contains only 1 item, the main file. The manual is opened from the product page on the site. Source code is not included. MT5 only; registration, account authentication and placing a license file are not required. Use it without changing the file name.

1

Extract the ZIP

Extract the ex5 main file rather than leaving it in the compressed file.

2

Open the data folder

In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.

3

Apply this product

Refresh the Navigator or restart MT5, and apply it to the target chart. Place only 1 instance of the same product on 1 chart.

4

Check the settings and display

First check with the default values. Changes and removal are done from the chart's 'Indicators List'.

This product does not require DLL permission or enabling automated trading. When removed, this product's drawings are cleared.

7

Settings

There are 14 inputs. Change them on the Inputs tab of the properties window. The English display names are shown together with the input names in the code.

Period 1

Name shown on screen
Period 1 (days, 0 = off)
Input name
InpDays1
Default
1
Allowed range
0 to 250 days
Description
Default 1 day. With 1 day it is shown as Prev Day. 0 hides it.

Period 2

Name shown on screen
Period 2 (days, 0 = off)
Input name
InpDays2
Default
5
Allowed range
0 to 250 days
Description
Default 5 days. The number of closed daily bars averaged. 0 hides it.

Period 3

Name shown on screen
Period 3 (days, 0 = off)
Input name
InpDays3
Default
10
Allowed range
0 to 250 days
Description
Default 10 days. 0 hides it.

Period 4

Name shown on screen
Period 4 (days, 0 = off)
Input name
InpDays4
Default
20
Allowed range
0 to 250 days
Description
Default 20 days. 0 hides it.

Period 5

Name shown on screen
Period 5 (days, 0 = off)
Input name
InpDays5
Default
60
Allowed range
0 to 250 days
Description
Default 60 days. 0 hides it.

Show today row

Name shown on screen
Show Today's Range
Input name
InpShowToday
Default
true
Allowed range
true / false
Description
Shows the range of the latest daily bar as Today. false hides this row.

Exclude weekend daily bars from averages

Name shown on screen
Skip Saturday and Sunday Bars
Input name
InpSkipWeekend
Default
true
Allowed range
true / false
Description
When true, daily bars starting on Saturday or Sunday are excluded when counting the specified number. Not applied to the Today row.

Points per 1 pip

Name shown on screen
Pip Size (points, 0 = auto)
Input name
InpPipPoints
Default
0
Allowed range
0〜1000000
Description
0 is automatic. If prices are shown with 3 or 5 digits, 1 pip = 10 points; otherwise 1 point. Specify a positive integer if needed.

Table corner

Name shown on screen
Corner
Input name
InpCorner
Default
Bottom left
Allowed range
Top left, bottom left, top right, bottom right
Description
The corner the table is anchored to. The default is bottom left.

Horizontal position

Name shown on screen
Horizontal Offset (pixels)
Input name
InpXOffset
Default
10
Allowed range
0〜2000 pixels
Description
Horizontal distance from the anchor corner.

Vertical position

Name shown on screen
Vertical Offset (pixels)
Input name
InpYOffset
Default
20
Allowed range
0〜2000 pixels
Description
Vertical distance from the anchor corner.

Font size

Name shown on screen
Font Size
Input name
InpFontSize
Default
11
Allowed range
6〜36
Description
The text size. A larger size also widens the spacing between rows and columns.

Heading and label color

Name shown on screen
Label Color
Input name
InpLabelColor
Default
Chocolate
Allowed range
Select an MT5 color
Description
Color of the table heading and the row names.

Value color

Name shown on screen
Value Color
Input name
InpValueColor
Default
SlateGray
Allowed range
Select an MT5 color
Description
Color of the values and of the hyphen for insufficient history.
8

Usage specifications

Date basis

Daily bars are divided by the terminal's server time. They do not necessarily match Japanese calendar days. With a different data source, the daily bars and displayed values may differ.

Today while the market is closed

Today is the latest daily bar. On weekends or market holidays when there is no new daily bar, the range of the previous trading day may remain.

Insufficient history and waiting for loading

If the required closed daily bars are insufficient, “-” is shown. While daily bars cannot be read, or when the series lags right after switching, the table from before the update remains, or nothing appears the first time.

Updates every 1 second

The table is redrawn on price updates and by a timer every 1 second. Updates are delayed depending on the state of the terminal and data. Update times to the second are not guaranteed.

A display that records past ranges

The numbers are the ranges of past days and the day in progress. They do not indicate trade direction, stop-loss or take-profit distances, or the remaining range from now on.

Avoid applying it more than once

If you place more than one instance of this product in the same corner, the displays may interfere. This manual assumes 1 instance on 1 chart; for comparisons, use separate charts.

Only 1 instance of the same product on 1 chart

This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.

For on-screen display only

It draws shapes and text on the chart. There is no plot buffer for retrieving calculated values. It does not place trade orders or issue alerts. It does not guarantee profit or market direction.

9

Troubleshooting and usage notes

The table overlaps bars and cannot be read

Move Corner to another corner, or adjust Horizontal / Vertical Offset. Also choose a text color that suits the background.

Period rows are missing or out of order

Rows set to 0 are not shown. The remaining rows follow the input order of Period 1 to 5 and are not sorted by number of days. If the number of days is the same, the same period appears in several rows.

Nothing is displayed

Check the input ranges and history. If Today is set to false and all periods are 0, it does not start. The reason is shown in English in the “Experts” tab.

“-” remains / values stop updating

Check the number of daily bars, the data feed and the connection status. Periods and weekend exclusion increase the history needed. While history arrives only in part, hyphens can also appear.

Pips differ from what you expect

Check the automatic Pip Size rule. For gold, indices, crypto assets and others, the convention is not unified, so specify the points per 1 pip to suit your purpose.

If the first display does not appear, check history loading and the input ranges. If an earlier display has stopped updating, first check the price feed and the terminal's connection status.

10

Technical information and specification details

Fetching and averaging daily bars

Goes back through the most recent closed daily bars, excluding today, up to 2 × days + 10 bars. If the specified number is not reached after excluding weekends, it shows “-”. Even with a 1-day period, with weekend exclusion it is the range of the most recent eligible weekday.

Rounding order

The high − low of each daily bar is rounded to points and summed. The total is divided by days × points per 1 pip and rounded to a whole number. It is not a calculation that rounds each day's pips first and then averages them.

Table layout and inputs

The text consists of labels on the chart. Row and column spacing is adjusted to the screen scale reported by the terminal, but the horizontal and vertical position inputs are not multiplied by the scale.

Difference from true range

This product does not use the previous close. Its definition differs from the calculations of Daily Info Panel and ATR. Comparison is possible only when the data source, daily bars, periods, weekend handling and unit all match.