Investment Studio > Expressions > Functions > Indicator > TR
float array[*][2] tr(float array[*][4] dhlc)
Returns a two-column array containing dates (first column) and corresponding True Range (TR) values (second column). Given n input rows in dhlc, n - 1 rows are returned.
dhlc is a four-column array containing daily price quotes. Each row is structured as follows:
| Column # | Content |
| 1 | The quote date. |
| 2 | The day's high (highest traded price). |
| 3 | The day's low (lowest traded price). |
| 4 | The day's close (last traded price). |
The array is assumed to be time-sorted, with earlier dates preceding later dates.
Automatic type conversion allows the use of date strings as arguments instead of explicit date values.
Interpretation
TR is a measure of daily volatility, defined as
TR = max(high - low, high - previous close, previous close - low)
Its primary use is as building block in other indicators (e.g. ATR, DI, DIM, DIP, KB). See in particular Average True Range (ATR).
The charts below show the price of Apple (NASD:AAPL) and the corresponding TR from June 1 to December 31, 2001:

Note how larger daily price moves (in particular, the island gaps on July 12 and 18) give rise to larger oscillations in the TR.
Example
Assuming standard US date format settings,
=tr({{"1/1/1990", 100, 90, 98}, {"1/2/1990", 97, 84, 86}})
returns {{32875, 13}}. 32875 is the date code for 1/2/1990; 13 is the TR value for that date. You can easily verify that
13 = max(97 - 84, 97 - 98, 84 - 98)