true_range

True Range (maximum range including gaps)

true_range()

Formula

```
True Range = MAX(
    high - low,
    |high - previous close|,
    |low - previous close|
)
```

Examples

// current bar range exceeds true range
(high - low) > true_range();

// strong volatility expansion
true_range() > sma(true_range(), 14) * 2;

// gap up detected
true_range() > (high - low) * 1.5;

// use with ATR for normalized volatility
true_range() > atr(14) * 1.5;

Returns

Float value representing the true range (always positive or zero) ## Notes - True Range captures gaps between bars that simple range (high - low) misses - Commonly used as the basis for ATR (Average True Range) - First bar has no previous close, so True Range = high - low - Always non-negative ## Related - `atr(periods)` - Moving average of True Range