all_time_high
All-Time High (Maximum value from inception)
all_time_high(source)
Returns the highest value ever reached for a given field from the first trading day to the current bar.
Parameters
- source (field, required): Field to track maximum value - typically high, close, or other price field
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
The maximum value of the specified field from inception to current bar.
Notes
- Requires full price history for accurate calculation (infinite lookback)
- Useful for identifying stocks near all-time highs
- Commonly used with percentage thresholds (e.g., close > ATH * 0.95)
- Works in MTF mtf() blocks for cross-timeframe analysis
- Value increases monotonically (never decreases over time)