OPEN-SOURCE SCRIPT
ATH Levels

ATH Levels
All-time high distance tracker with dynamic tolerance zones, trend leg measurement, and precision alerts for SPY pullback and correction entries.
---
What it does:
ATH Levels automatically tracks the all-time high price and plots key percentage retracement levels below it. Each level represents a statistically significant support zone where SPY has historically shown mean reversion behavior — making them ideal reference points for swing and long term entry planning.
Key levels:
- ATH — current all-time high with days elapsed counter
- -3% / -4% — shallow pullback zones, first reaction levels
- -5% — standard pullback threshold, high probability bounce zone
- -10% — correction territory entry zone
- -15% / -20% — deep correction zones, high conviction long term entries
- -25% — bear market territory (disabled by default)
Dynamic tolerance zones:
Only the two nearest levels to current price show active tolerance bands — keeping the chart clean while highlighting exactly where price is most likely to react. Tolerance is tighter near ATH (-3%/-4% = 0.20%) and wider at deeper levels (0.30%).
Now label:
A floating label at current price shows exact distance from ATH in real time — instantly telling you where you stand in the pullback structure.
Trend Leg %:
Measures the current price move from the last weekly pivot low (when near ATH) or pivot high (when in correction). Displayed directly on the ATH label — showing how extended the current leg is and whether a continuation or reversal is more likely.
---
Key features:
- Analysis mode — reveals all colored level lines and tolerance boxes simultaneously for detailed review
- Anti-spam pivot engine — alerts fire once per confirmed pivot leg
- Individual and master alert system for every level
- Fully customizable colors, widths, and tolerances per level
---
Alert types (per level):
- Near — price approaching within tolerance zone
- Touch — price has intersected the level
- Over — price has broken above tolerance zone after a touch
- Under — price has broken below tolerance zone after a touch
---
How to use:
- On Daily chart — use levels for swing and long term entry planning with pyramiding
- On 1H chart — combine with Bias indicator verdicts for higher conviction entries
- Now label gives instant ATH distance context at a glance
- Trend Leg % on ATH label helps identify overextended moves before reversals
All-time high distance tracker with dynamic tolerance zones, trend leg measurement, and precision alerts for SPY pullback and correction entries.
---
What it does:
ATH Levels automatically tracks the all-time high price and plots key percentage retracement levels below it. Each level represents a statistically significant support zone where SPY has historically shown mean reversion behavior — making them ideal reference points for swing and long term entry planning.
Key levels:
- ATH — current all-time high with days elapsed counter
- -3% / -4% — shallow pullback zones, first reaction levels
- -5% — standard pullback threshold, high probability bounce zone
- -10% — correction territory entry zone
- -15% / -20% — deep correction zones, high conviction long term entries
- -25% — bear market territory (disabled by default)
Dynamic tolerance zones:
Only the two nearest levels to current price show active tolerance bands — keeping the chart clean while highlighting exactly where price is most likely to react. Tolerance is tighter near ATH (-3%/-4% = 0.20%) and wider at deeper levels (0.30%).
Now label:
A floating label at current price shows exact distance from ATH in real time — instantly telling you where you stand in the pullback structure.
Trend Leg %:
Measures the current price move from the last weekly pivot low (when near ATH) or pivot high (when in correction). Displayed directly on the ATH label — showing how extended the current leg is and whether a continuation or reversal is more likely.
---
Key features:
- Analysis mode — reveals all colored level lines and tolerance boxes simultaneously for detailed review
- Anti-spam pivot engine — alerts fire once per confirmed pivot leg
- Individual and master alert system for every level
- Fully customizable colors, widths, and tolerances per level
---
Alert types (per level):
- Near — price approaching within tolerance zone
- Touch — price has intersected the level
- Over — price has broken above tolerance zone after a touch
- Under — price has broken below tolerance zone after a touch
---
How to use:
- On Daily chart — use levels for swing and long term entry planning with pyramiding
- On 1H chart — combine with Bias indicator verdicts for higher conviction entries
- Now label gives instant ATH distance context at a glance
- Trend Leg % on ATH label helps identify overextended moves before reversals
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.