Volatility / Reference
alerta.ta.tr
TradingView-compatible spelling: ta.tr, runs without warnings
Calculates the True Range for each bar. Pine v6 form is `ta.tr(handle_na)` operating on chart H/L/C; a legacy 3-arg form accepting custom series is also supported.
alerta.ta.tr(handle_na = false) or tr(high, low, close) → series floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
handle_na | series bool | No | — | If true, returns high - low when the previous close is na (avoids na in the first bars). Defaults to false. (Pine v6 form: ta.tr(handle_na)) |
low | series | No | — | Low series — legacy 3-arg form only. |
close | series | No | — | Close series — legacy 3-arg form only. |
Returns
series floatExample
alerta.ta.tr
plot(ta.tr(true), { pane: "oscillator" })plot(tr(high, low, close), { pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.