VolatilityPine Script v6Built-in Variable

ta.tr

True Range (Variable)

True range, equivalent to ta.tr(handle_na = false). It is calculated as math.max(high - low, math.abs(high - close[1]), math.abs(low - close[1])).

Syntax

Syntax
ta.tr

Returns

series float

Remarks

This is the built-in series variable ta.tr. For explicit NaN handling, use the ta.tr() function with handle_na.

Code Examples

Pine Script v6 Example
//@version=6
indicator("True Range (variable)")
plot(ta.tr, color=color.blue)

Trading Applications

Quick access to true range without a function call

Use in custom ATR calculations

Measure single-bar volatility

Detect gap bars with high true range

Related Functions

Frequently Asked Questions

Generate ta.tr Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.tr and other built-in functions instantly.