all_time_high
All-Time High (Maximum value from inception)
all_time_high(source)
Parameters
| Name | Type | Description |
|---|---|---|
source |
field | Field to track maximum value, typically high or close |
Formula
all_time_high(field) = MAX(field) from first trading day to current bar
Examples
all_time_high(high); # Highest price ever reached
all_time_high(close); # Highest closing price ever
close > all_time_high(high) * 0.95; # Within 5% of all-time high
weekly_ath = mtf("1W") { all_time_high(high); }; # Weekly ATH for cross-timeframe analysis
Returns
float
Notes
Requires full price history (infinite lookback); useful for identifying stocks near all-time highs, commonly with percentage thresholds like close > all_time_high(high) * 0.95; works in mtf() blocks for cross-timeframe analysis; the value increases monotonically, never decreasing over time