OPEN-SOURCE SCRIPT
Previous Day Regular Session OHLC Levels

Previous Day RTH OHLC Levels
This indicator displays the most recent completed regular trading session’s Open, High, Low, and Close levels on an intraday chart.
It was built for traders who keep extended-hours data visible but still want clean reference levels from the regular session only. For U.S. equities, the default regular session is set to 09:30 to 16:00, and the default after-hours session is set to 16:00 to 20:00.
What it shows
PDH: Previous regular-session high
PDL: Previous regular-session low
PDC: Previous regular-session close
PDO: Previous regular-session open
The indicator tracks the current regular session’s OHLC values during the day. When after-hours begins, it locks those values and displays them as the prior completed regular-session levels.
Why use it
These levels can be useful as reference points for intraday context, especially when viewing premarket or after-hours price action. They can help show whether price is trading above or below the prior regular-session range, open, or close.
Settings
Regular session: default 0930-1600
After-hours session: default 1600-2000
Show or hide solid OHLC lines
Show or hide right-side labels
Adjust label offset, label size, and line width
Important notes
This is not a buy or sell signal. It does not predict direction. It simply plots prior regular-session OHLC reference levels.
For best results, use it on intraday charts with extended-hours data enabled. It is designed around U.S. equity market hours.
This indicator displays the most recent completed regular trading session’s Open, High, Low, and Close levels on an intraday chart.
It was built for traders who keep extended-hours data visible but still want clean reference levels from the regular session only. For U.S. equities, the default regular session is set to 09:30 to 16:00, and the default after-hours session is set to 16:00 to 20:00.
What it shows
PDH: Previous regular-session high
PDL: Previous regular-session low
PDC: Previous regular-session close
PDO: Previous regular-session open
The indicator tracks the current regular session’s OHLC values during the day. When after-hours begins, it locks those values and displays them as the prior completed regular-session levels.
Why use it
These levels can be useful as reference points for intraday context, especially when viewing premarket or after-hours price action. They can help show whether price is trading above or below the prior regular-session range, open, or close.
Settings
Regular session: default 0930-1600
After-hours session: default 1600-2000
Show or hide solid OHLC lines
Show or hide right-side labels
Adjust label offset, label size, and line width
Important notes
This is not a buy or sell signal. It does not predict direction. It simply plots prior regular-session OHLC reference levels.
For best results, use it on intraday charts with extended-hours data enabled. It is designed around U.S. equity market hours.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.