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.
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.
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.
Read the unit and the multiplierThe size of the numbers cannot be compared directly between Pips x1 and Points x2.
Forming or closed barForming Bar gives interim values; Last Closed Bar gives the value of the closed higher-timeframe bar 1 before.
Compares the default settings and a settings change example on a screen with only this product applied.
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.
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.
The chart's own timeframe is the thick blue line. The others are colored in the order of the usable longer timeframes, from shortest.
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.
Draws the ATR of each timeframe at the time of each chart bar. It is not a panel that builds side-by-side sections.
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.
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.
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.
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.
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.
| Chart | M1 | M5 | M15 | M30 | H1 | H4 | D1 | W1 | MN1 |
|---|---|---|---|---|---|---|---|---|---|
| M1 | 14 / 15 | 71 / 76 | 211 / 226 | 421 / 451 | 841 / 901 | 3,361 / 3,601 | 20,161 / 21,601 | 100,801 / 108,001 | 439,201 / 469,441 |
| M5 | — | 14 / 15 | 43 / 46 | 85 / 91 | 169 / 181 | 673 / 721 | 4,033 / 4,321 | 20,161 / 21,601 | 87,841 / 93,889 |
| M15 | — | — | 14 / 15 | 29 / 31 | 57 / 61 | 225 / 241 | 1,345 / 1,441 | 6,721 / 7,201 | 29,281 / 31,297 |
| M30 | — | — | — | 14 / 15 | 29 / 31 | 113 / 121 | 673 / 721 | 3,361 / 3,601 | 14,641 / 15,649 |
| H1 | — | — | — | — | 14 / 15 | 57 / 61 | 337 / 361 | 1,681 / 1,801 | 7,321 / 7,825 |
| H4 | — | — | — | — | — | 14 / 15 | 85 / 91 | 421 / 451 | 1,831 / 1,957 |
| D1 | — | — | — | — | — | — | 14 / 15 | 71 / 76 | 306 / 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.
Check the period, unit, multiplier and the order of timeframes in the window name ATR(…).
Align Units and Range Multiplier before comparing with another screen.
Choose whether to see interim values or the values of the closed higher-timeframe bar 1 before.
If the short lines are hard to see because of the long timeframes, reduce Number Of Timeframes.
| Included file | Purpose / location |
|---|---|
| TRI_MTF_ATR.ex5 | The 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.
Extract the ex5 main file rather than leaving it in the compressed file.
In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.
Refresh the Navigator or restart MT5, and apply it to the target chart. Place only 1 instance of the same product on 1 chart.
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.
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.
InpPeriodInpUnitsInpMultiplierInpTimeframesInpBarModeIt 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.
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.
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.
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.
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.
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.
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.
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.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
This product is for displaying calculation results on the screen. It does not guarantee future price movement.
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.
Negative scale values can appear in the margin of the automatic vertical-axis adjustment. This does not mean that the ATR itself becomes negative.
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.
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.
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.
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.
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.
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.
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.
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.