Guac's Daily ATR Box (Remaining > Locked w/ Extensions)This script is an intraday visualization tool that uses the Average True Range (ATR) from the Daily timeframe to show, in real time, how much of the day’s typical range has been “used” and when the day’s move has fully consumed that range. Once the daily ATR is “filled,” the script locks that ATR zone for the rest of the day and highlights any additional movement beyond it (ATR extensions).
---
What the script does
1) Pulls Daily ATR and anchors it for intraday use
2) Tracks the day’s current high and low intraday
* As each intraday bar prints, it updates:
- dayHigh = the highest price so far today
- dayLow = the lowest price so far today
3) Shows a “Remaining ATR” zone that adapts in real time (pre-fill)
* Before the day has used a full ATR of range, the script draws a primary box (Segment 0) that represents the remaining potential movement inside the day’s ATR “budget.”
* Conceptually throughout the day the box “shrinks” to visualize how much range is left:
- As new highs are made, some of the “budget” is spent upward.
- As new lows are made, some of the “budget” is spent downward.
4) Detects when the day’s range has “filled” ATR and locks the zone
* The script considers ATR “filled” when:
- (dayHigh − dayLow) ≥ Daily ATR
* At the first moment this happens:
- The script locks Segment 0 into a static ATR zone for the remainder of the day.
- It also records whether the zone was locked from the day’s low upward or from the day’s high downward (shown as LOW-ANCHORED / HIGH-ANCHORED).
5) Highlights extensions beyond the locked ATR zone (post-fill)
* After the ATR zone is locked:
- Any move beyond that locked zone triggers “extension” boxes.
- Extensions are shown as additional ATR-sized blocks above or below the locked zone.
* Extension colors escalate by distance:
- ATR×1+ extension (first block outside) = yellow
- ATR×2+ extension (second block) = orange
- ATR×3+ extension (third block and beyond) = red
This makes it visually obvious when price is no longer moving within a “normal” daily range and is now in volatility expansion / extension territory.
6) HUD status display
* A small HUD table shows:
- The ticker and Daily ATR value
- Whether the ATR range is still LIVE (adapting with remaining dollars) or Range Filled & Locked
Pine Script® indicator





