Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.ta.tr
On this pageSignatureParametersReturnsExample

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 float

Parameters

NameTypeRequiredDefaultDescription
handle_naseries boolNo—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))
lowseriesNo—Low series — legacy 3-arg form only.
closeseriesNo—Close series — legacy 3-arg form only.

Returns

series float

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.