TRANGE
TRANGE
Summary
True Range: the greatest of today's high-low span and the two gaps between yesterday's close and today's high/low. Base volatility measure used to build ATR/NATR. Larger values mean wider or gappier bars (higher volatility).
Formula
TR = max( high - low, |prevClose - high|, |prevClose - low| )
Notes
- The first bar produces no value because it has no prior close; unlike some definitions, it does not fall back to the high-low range for that bar.
Inputs
inHigh— High price of each barinLow— Low price of each barinClose— Close price of each bar
Outputs
outReal— True Range value per bar
Properties
Numerical Stability: Start-Independent
| Display Flags |
|---|
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
Implementation
TA-Lib Definition: trange.c · trange.yaml
| Native | File |
|---|---|
| C | ta_TRANGE.c |
| Rust | trange.rs |
| Java | Core_TRANGE.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
True Range, TR
See Also
References
- J. Welles Wilder, New Concepts in Technical Trading Systems, Trend Research (ISBN 0894590278)