ta.tr
Measure the full range of a bar, including any gap from the previous close.
ta.tr(bars)True range of bars: max(high-low, abs(high-close[1]), abs(low-close[1])).
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
Warm-up and missing values
- Warm-up
- None.
- Missing values
- On the first bar the previous close is unknown, so true range is high - low. na while a declared series has no bar available.
Example
ta.tr()plot(ta.tr(), "True range")