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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.