MT5 indicators← MTF ATR 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

MTF ATR

Overlays the ATR of the chart's timeframe and of longer timeframes as lines. The unit can be selected from pips, points or price, and a common multiplier can be applied to all lines.

Indicator name: MTF ATRMetaTrader 5Separate window

Check 3 things: timeframe, unit and timing

Averages the true range of each timeframeForming Bar or Last Closed BarConversion to the unit × common multiplierRead with the timeframe, unit and multiplier of the lines aligned
Schematic diagram of how to read it. This is not an actual terminal screen.
1

Timeframes are in the order of the window nameOn H1, they are H1, H4, D1, W1, MN1. The colors are decided by the order from the shortest.

2

Read the unit and the multiplierThe size of the numbers cannot be compared directly between Pips x1 and Points x2.

3

Forming or closed barForming Bar gives interim values; Last Closed Bar gives the value of the closed higher-timeframe bar 1 before.

MT5 onlyPips / Points / PriceUp to 9 timeframes
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
Value unit
InpUnits
Pips → Points
Multiplier
InpMultiplier
1 → 2
Maximum number of timeframes
InpTimeframes
5 → 9
Handling of higher-timeframe values
InpBarMode
Forming Bar (As Of Each Chart Bar) → Last Closed Bar

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 settingsInpUnits = Pips / InpMultiplier = 1 / InpTimeframes = 5 / InpBarMode = Forming Bar (As Of Each Chart Bar)
MTF ATR default settings
Default: ATR14, Pips, multiplier 1, Forming Bar. 5 lines from H1 to MN1. Longer timeframes have larger values, and lines for shorter timeframes sit near the bottom edge.
View the screen in detail at full size
MTF ATR default settings (full size)
Example of changed settingsInpUnits = Points / InpMultiplier = 2 / InpTimeframes = 9 / InpBarMode = Last Closed Bar
MTF ATR example of changed settings
Changed example: changed to Points, multiplier 2, Last Closed Bar and a maximum of 9. On H1, 5 timeframes are usable, so there are still 5 lines. The unit, the multiplier and the bars referred to have changed.
View the screen in detail at full size
MTF ATR example of changed settings (full size)

Example shown: 1-hour timeframe (H1). This is an example to explain the display. The changed settings are not recommended values. Details can be checked in the full-size view. Also check the vertical axis and units of the separate window. Except for products with a fixed scale, the scale changes with the settings and the display range.

2

How to read it in 30 seconds

Meaning of ATR

The simple average of the true range, which uses the high, the low and the previous close. It does not show the direction of the price.

How to tell the lines apart

The chart's own timeframe is the thick blue line. The others are colored in the order of the usable longer timeframes, from shortest.

Latest and previous values

The current value is the Forming Bar of the latest bar. To read the previous closed value of a higher timeframe, use Last Closed Bar.

3

What it measures

Draws the ATR of each timeframe at the time of each chart bar. It is not a panel that builds side-by-side sections.

True range

Includes not only high − low but also the spread from the previous close to the high or low. It is a simple average over a period of N bars, not Wilder smoothing.

Timeframes used

Following the chart itself, it selects in order the longer timeframes that can be built from M1, M5, M15, M30, H1, H4, D1, W1 and MN1. On a weekly or monthly chart, there is only 1 line for the chart itself.

Values at the same time

Forming Bar uses the interim higher-timeframe bar up to that chart bar. Last Closed Bar uses the closed higher-timeframe bar 1 before, so the same value continues within the interval of the same higher-timeframe bar.

The same conversion for all lines

ATR × multiplier ÷ unit. Pips is 10 point for 3- or 5-digit prices and 1 point otherwise. Points is 1 point, and Price is not converted and stays in price units.

Open the guide to the required history

This is a calculated guide. It assumes a calendar from January 1, 2024 with bars at each timeframe's interval for 24 hours from Monday to Friday (no Saturday or Sunday bars; weekday market holidays are not considered). The number of bars changes with the broker's actual bars, holidays, the start position of the history and the number of days in a month. It is not a guarantee that the display always starts from this number of bars on the terminal.

ATR 14: Forming Bar / Last Closed Bar (up to 9 slots)

ChartM1M5M15M30H1H4D1W1MN1
M114 / 1571 / 76211 / 226421 / 451841 / 9013,361 / 3,60120,161 / 21,601100,801 / 108,001439,201 / 469,441
M5—14 / 1543 / 4685 / 91169 / 181673 / 7214,033 / 4,32120,161 / 21,60187,841 / 93,889
M15——14 / 1529 / 3157 / 61225 / 2411,345 / 1,4416,721 / 7,20129,281 / 31,297
M30———14 / 1529 / 31113 / 121673 / 7213,361 / 3,60114,641 / 15,649
H1————14 / 1557 / 61337 / 3611,681 / 1,8017,321 / 7,825
H4—————14 / 1585 / 91421 / 4511,831 / 1,957
D1——————14 / 1571 / 76306 / 327
W1———————14 / 15—
MN1————————14 / 15

Each cell is in the order Forming Bar / Last Closed Bar. The default is 5 slots, so in each row up to 5 from the left, excluding —, are used. On the same timeframe as the chart, values appear from the 14th / 15th bar; on longer timeframes, from the 15th / 16th interval, also counting the first unused interval.

4

Situations for reading the display

Lines of short timeframes look flat

Indicator
Lines at the bottom edge of the subwindow
Cross-check
The scale is fitted to the large values of longer timeframes.
Check
Reduce Number Of Timeframes to see the short timeframes.
Caution
Do not read the value as 0 from its apparent height alone.

The header shows 0

Indicator
The line of the timeframe concerned
Cross-check
Even when a line cannot be calculated because of insufficient history, 0 appears in the heading.
Check
Check whether the line is present and check the required-history table.
Caution
From the heading alone, this cannot be told apart from a calculated ATR of 0.

The value does not change from the previous bar

Indicator
Last Closed Bar
Cross-check
The closed value 1 bar before on the higher timeframe continues throughout that interval.
Check
Compare it with the switching of the higher-timeframe intervals.
Caution
1 chart bar before is not necessarily 1 higher-timeframe bar before.
5

Steps for checking the display

1

Apply with the defaults

Check the period, unit, multiplier and the order of timeframes in the window name ATR(…).

2

Align the units

Align Units and Range Multiplier before comparing with another screen.

3

Choose the timing

Choose whether to see interim values or the values of the closed higher-timeframe bar 1 before.

4

Adjust the number of lines

If the short lines are hard to see because of the long timeframes, reduce Number Of Timeframes.

6

Installation and checking the package contents

Included filePurpose / location
TRI_MTF_ATR.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'.

Using this product does not require allowing DLLs. When removed, this product's drawings are cleared.

7

Settings

There are 5 inputs. Change them on the Inputs tab of the properties. The English display name and the input name in the code are shown together.

ATR period

Name shown on screen
ATR Period
Input name
InpPeriod
Default
14
Allowed range
1〜500
Description
Specifies how many bars of the true range of each timeframe are averaged.

Value unit

Name shown on screen
Units
Input name
InpUnits
Default
Pips
Allowed range
Pips / Points / Price
Description
Common to all lines. Pips is shown with 1 decimal place, Points as integers, and Price with the price digits. Display rounding is separate from the calculated value itself.

Multiplier

Name shown on screen
Range Multiplier
Input name
InpMultiplier
Default
1
Allowed range
0.1〜10
Description
Applied to all ATR values before conversion. Specify a finite number.

Maximum number of timeframes

Name shown on screen
Number Of Timeframes
Input name
InpTimeframes
Default
5
Allowed range
1〜9
Description
The chart's own line is also counted. On H1 the maximum is 5, and on a weekly or monthly chart it is 1; raising the limit does not increase it beyond that.

Handling of higher-timeframe values

Name shown on screen
Higher Timeframe Value
Input name
InpBarMode
Default
Forming Bar (As Of Each Chart Bar)
Allowed range
Forming Bar (As Of Each Chart Bar) / Last Closed Bar
Description
Forming Bar uses the interim higher-timeframe bar known as of each chart bar; Last Closed Bar uses the closed higher-timeframe bars up to 1 bar before.
8

Usage specifications

Higher timeframes are built from the current chart

It does not read the history of other timeframes directly; it groups the bars loaded in the current chart. There are no higher-timeframe bars older than the chart's history. For longer timeframes, the section containing the chart's first bar is not used. In calculations for the same timeframe, the first bar is also used.

Day, week and month boundaries

In server time, the boundary is 00:00 for daily bars, Sunday 00:00 for weekly bars and 00:00 on the 1st of the month for monthly bars. Sections without bars are not filled with new bars. If there are bars on Sunday, that day is also counted as 1 daily bar.

Results change with the history

The calculation is redone when the chart's history is added or corrected, or when the oldest bar or the settings change. For recursively calculated EMA, SMMA, RSI and ADX, past values and colors may also change. It is not guaranteed that past displays remain unchanged under all conditions.

Handling while forming and after closing

Forming Bar changes during the latest bar. Closed chart bars are designed to keep the values known up to that bar. Last Closed Bar uses the closed value from 1 bar before on that timeframe, so the state is the same while within the same higher-timeframe bar. Recalculation caused by changes in history or settings is an exception.

Reading the value of the previous higher-timeframe bar

If the chart bar 1 before is within the same higher-timeframe bar, its value is not that of the previous higher-timeframe bar. Refer to the last bar of the higher-timeframe section 1 before, or use Last Closed Bar.

The 0 in the header and empty lines

Lines for which there are not enough higher-timeframe bars for the calculation are not drawn. In this case, the 0 in the header is not a measured ATR of 0 but an indication of insufficient calculation. Even with enough bars, a true ATR of 0 is possible during periods when the price does not move.

Relationship with the standard ATR

The line for the chart's own timeframe is the simple average of true range, the same as the MT5 standard ATR. For higher timeframes, the start of the history and the forming/closed timing differ, so the value is not unconditionally the same as the standard ATR on a separate chart.

Colors are not fixed per timeframe

From shortest: blue, orange, purple, teal, ocher, blue-gray, dark pink, brown, navy. H1 is blue on an H1 chart, but on an M1 chart with 9 slots it is the 5th, ocher. When you change the chart's timeframe, also check the order of the names.

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

This product is for displaying calculation results on the screen. It does not guarantee future price movement.

9

Troubleshooting and usage notes

Only the longer timeframes do not appear

With the default 14 periods, longer timeframes start from the 15th interval, counting the first unused interval. Check the required-history table and the number of bars loaded.

There are negative numbers on the scale

Negative scale values can appear in the margin of the automatic vertical-axis adjustment. This does not mean that the ATR itself becomes negative.

The numbers change between Pips and Points

In the example of a 5-digit price, 1 pip=10 points. With a multiplier of 2 as well, the Points value for the same original ATR is 20 times the value with Pips and multiplier 1. The changed example shown also switches to closed bars, so the values in the image are not necessarily simply 20 times.

Cannot start

Check the input ranges. If startup is refused, the reason appears as 1 line in English on the MT5 Experts tab. No panel with the reason appears on the chart. Inputs that are not used are also range-checked.

It does not match other charts

Check the timeframe, the inputs, the start of the history and how the intervals are split. Even an indicator with the same name does not match if it differs in whether values are interim or final, or in the history used for the calculation.

The required history is insufficient

Calculating longer timeframes needs many chart bars. Check the "Max bars in chart" limit and the history actually loaded. Raising the limit alone does not necessarily bring in all history that has not yet been downloaded.

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

ATR formula

For the first bar calculated, it is high − low. After that, max(high, previous close) − min(low, previous close) is the true range, and it is simple-averaged over the period.

First interval and standard ATR

The close of the first unused interval of the higher timeframe is not used. For this reason, the ATR of the interval where the line starts may differ from the standard ATR on another chart. After that, a timing difference also remains when interim higher-timeframe values are compared with closed values.

Required number of bars

With period n, on the same timeframe Forming starts from bar n and Last Closed from bar n+1. Longer timeframes start from the n+1st / n+2nd interval, counting the first unused interval.

Display digits

Pips uses 1 decimal place, Points integers, and Price the number of price digits. The internal calculated values are not rounded to these display digits. The multiplier in the window name may also be shown with display digits.