OPEN-SOURCE SCRIPT
Previous/Current Day High/Low/Open/Close Levels

This Pine Script creates a TradingView indicator that displays key price levels from previous and current trading days. Here's what it does:
Main Features
Price Level Display:
Previous Day High (PDH) - Highest price from yesterday
Previous Day Low (PDL) - Lowest price from yesterday
Previous Day Close (PDC) - Closing price from yesterday
Current Day Open (DO) - Opening price of today
Intraday High (IDH) - Highest price reached so far today
Intraday Low (IDL) - Lowest price reached so far today
Key Settings
Days Back - Shows levels for the last 1-30 days (default: 5 days)
Line Extension - Projects lines forward beyond the current candle (default: 25 bars)
Toggle Controls - Turn each level on/off individually
Customizable Colors - Each level has its own color (red for highs, green for lows, etc.)
Labels - Optional text labels (PDH, PDL, etc.) positioned on left or right side
How It Works
The script draws horizontal lines at these key price levels throughout the trading day. Lines break at each new day to avoid connecting across sessions. Dashed connector lines extend to the labels for easy identification.
This is particularly useful for intraday traders who watch these levels for potential support/resistance zones and breakout opportunities.
Main Features
Price Level Display:
Previous Day High (PDH) - Highest price from yesterday
Previous Day Low (PDL) - Lowest price from yesterday
Previous Day Close (PDC) - Closing price from yesterday
Current Day Open (DO) - Opening price of today
Intraday High (IDH) - Highest price reached so far today
Intraday Low (IDL) - Lowest price reached so far today
Key Settings
Days Back - Shows levels for the last 1-30 days (default: 5 days)
Line Extension - Projects lines forward beyond the current candle (default: 25 bars)
Toggle Controls - Turn each level on/off individually
Customizable Colors - Each level has its own color (red for highs, green for lows, etc.)
Labels - Optional text labels (PDH, PDL, etc.) positioned on left or right side
How It Works
The script draws horizontal lines at these key price levels throughout the trading day. Lines break at each new day to avoid connecting across sessions. Dashed connector lines extend to the labels for easy identification.
This is particularly useful for intraday traders who watch these levels for potential support/resistance zones and breakout opportunities.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no pretenden ser, ni constituyen, asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no pretenden ser, ni constituyen, asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.