OPEN-SOURCE SCRIPT
2 AM 4H Candle Levels

**2 AM 4H Candle Levels**
This indicator marks the high and low of the 4-hour candle that opens at 2:00 AM and projects those levels forward through the rest of the trading day — for every historical day on the chart as well as the current session.
Many intraday strategies treat the early-morning 4H range (2 AM – 6 AM) as a key reference: it often brackets the pre-session liquidity that price later sweeps or respects once the more active hours begin. This tool makes that range visible at a glance so you can watch how price interacts with it — breakouts, retests, or rejections — without redrawing levels every day.
**What it draws**
- **Window box** — a box spanning the full 4H window, from the 2 AM open to the 6 AM close, framed at the candle's high and low. The left and right borders mark the open and close times; the top and bottom borders trace the range. Optional fill with adjustable transparency.
- **Extended level lines** — from the 6 AM close, a high line and a low line carry the range forward. You choose where they stop: **End of day**, or a **Custom time** you set (e.g. 9:30 AM for the NYSE open).
- On the **current day**, the box builds in real time while the 2 AM candle is still forming, and the lines can optionally extend to the right edge of the chart until their cutoff arrives.
**Settings**
- **4H candle open hour** — defaults to 2 AM; anchor the window to any hour.
- **Timezone** — "Exchange" by default; set it to match your chart's displayed timezone (UTC, America/New_York, GMT+2, …) so the window lands on the candle you see.
- **Lines end at** — End of day, or a custom hour/minute (24-hour clock).
- **Window box** — show/hide, border color, width, style (solid/dashed/dotted), and fill color.
- **Extended lines** — independent colors for the high and low lines, width, and style.
**How it works**
The script does not rely on `request.security`. It identifies all chart bars whose open time falls inside the 4-hour window (in your chosen timezone) and accumulates their high and low directly. This keeps the levels accurate and non-repainting on any intraday timeframe — from 1 minute up to 4 hours — and means the levels appear at the window itself rather than four hours late, a common artifact of higher-timeframe data requests.
**Notes & limitations**
- Works on intraday timeframes up to 4H. On Daily and above a whole day is a single bar, so there is nothing to draw; the indicator shows a small notice instead.
- If the levels don't line up with the candle you expect, the timezone setting is almost always the reason — match it to the clock at the bottom-right of your chart.
- TradingView caps drawing objects per indicator, so history reaches back roughly 250 trading days.
---
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.