OPEN-SOURCE SCRIPT
Updated Previous & Current Day Levels

Pine Script indicator that displays key price levels from the previous trading day and the current day's opening price on your chart.
What it displays:
The script draws four horizontal reference lines across your chart:
Previous Day High (PDH) - The highest price reached yesterday
Previous Day Low (PDL) - The lowest price reached yesterday
Previous Day Close (PDC) - Yesterday's closing price
Daily Open (DO) - Today's opening price
Key features:
Visual customization - You can adjust colors, line styles (solid/dashed/dotted), line thickness, and text size for all levels
Label positioning - Labels can be offset to the right of the current price action to keep them visible and out of the way
Flexible display - Choose between full descriptive labels ("Prev Day High") or shorthand abbreviations ("PDH")
Performance optimization - The script limits how far back lines are drawn (configurable up to 5000 bars) to prevent rendering issues
Clean presentation - Each level includes a solid horizontal line from its starting point, plus a dotted connector line extending to the label
Why traders use it:
These levels are important reference points for intraday traders. Previous day levels often act as support/resistance zones, and the daily open helps identify potential trend direction. The script automatically updates these levels each day, making it easy to track key price areas without manual drawing.
What it displays:
The script draws four horizontal reference lines across your chart:
Previous Day High (PDH) - The highest price reached yesterday
Previous Day Low (PDL) - The lowest price reached yesterday
Previous Day Close (PDC) - Yesterday's closing price
Daily Open (DO) - Today's opening price
Key features:
Visual customization - You can adjust colors, line styles (solid/dashed/dotted), line thickness, and text size for all levels
Label positioning - Labels can be offset to the right of the current price action to keep them visible and out of the way
Flexible display - Choose between full descriptive labels ("Prev Day High") or shorthand abbreviations ("PDH")
Performance optimization - The script limits how far back lines are drawn (configurable up to 5000 bars) to prevent rendering issues
Clean presentation - Each level includes a solid horizontal line from its starting point, plus a dotted connector line extending to the label
Why traders use it:
These levels are important reference points for intraday traders. Previous day levels often act as support/resistance zones, and the daily open helps identify potential trend direction. The script automatically updates these levels each day, making it easy to track key price areas without manual drawing.
Release Notes
fixed some issues.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.