true_range

True Range (maximum range including gaps)

true_range()

Formula

true_range = GREATEST(high - low, |high - close[1]|, |low - close[1]|)

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

Notes

GREATEST ignores the single NULL LAG(close) produces on the first bar, so this never returns NULL

See Also

atr