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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน