OPEN-SOURCE SCRIPT
PDH PDL Open Close

PDH/PDL/Open/Close Levels Indicator
Overview
This Pine Script indicator plots the Previous Day High (PDH), Previous Day Low (PDL), Previous Day Open (PDO), and Previous Day Close (PDC) levels on your chart. It's designed for traders who rely on key daily levels to identify potential support, resistance, and intraday reference points. The indicator supports multiple timeframes, allowing you to visualize these levels from higher timeframes (e.g., weekly or monthly) directly on lower timeframe charts.
Built with Pine Script v6, it's lightweight, customizable, and overlays seamlessly on any symbol. Lines extend slightly into the future for better visibility, and labels provide clear identification with price values.
Key Features
- Multi-Timeframe Support: Choose from predefined timeframes (5m to 1M) via the input settings to fetch and plot levels from the selected period.
- Clean Visualization:
- PDH and PDL: Solid black lines for high/low levels.
- PDO: Dotted blue line for the opening price.
- PDC: Dotted red line for the closing price.
- Dynamic Labels: Automatically placed at the end of each line, showing the timeframe and exact price (e.g., "1D High: 150.25").
- Efficient Updates: Lines and labels update in real-time without cluttering the chart—old elements are automatically cleaned up.
- Extension Handling: Lines extend 2 bars ahead by default, adjustable if needed via code modifications.
How to Use
1. Add to Chart**: Copy the script into TradingView's Pine Editor, save, and add it to your chart.
2. Customize Timeframe: In the indicator settings, select your desired timeframe (default: 1D). This pulls levels from the previous period of that timeframe.
3. Interpret Levels:
- Use PDH/PDL as potential resistance/support zones.
- PDO/PDC can highlight session biases (e.g., gap fills or continuation patterns).
- Ideal for day trading, swing setups, or aligning with higher timeframe context.
4. Best Practices: Works on any market (stocks, forex, crypto). Combine with volume or momentum indicators for confluence.
Settings
- Timeframe: Dropdown with options: 5m, 10m, 15m, 30m, 45m, 1H, 2H, 3H, 4H, 1D, 1W, 1M.
- No other inputs for simplicity—colors, styles, and extensions are hardcoded for a clean default look. Edit the script to tweak (e.g., line colors or extension length).
Overview
This Pine Script indicator plots the Previous Day High (PDH), Previous Day Low (PDL), Previous Day Open (PDO), and Previous Day Close (PDC) levels on your chart. It's designed for traders who rely on key daily levels to identify potential support, resistance, and intraday reference points. The indicator supports multiple timeframes, allowing you to visualize these levels from higher timeframes (e.g., weekly or monthly) directly on lower timeframe charts.
Built with Pine Script v6, it's lightweight, customizable, and overlays seamlessly on any symbol. Lines extend slightly into the future for better visibility, and labels provide clear identification with price values.
Key Features
- Multi-Timeframe Support: Choose from predefined timeframes (5m to 1M) via the input settings to fetch and plot levels from the selected period.
- Clean Visualization:
- PDH and PDL: Solid black lines for high/low levels.
- PDO: Dotted blue line for the opening price.
- PDC: Dotted red line for the closing price.
- Dynamic Labels: Automatically placed at the end of each line, showing the timeframe and exact price (e.g., "1D High: 150.25").
- Efficient Updates: Lines and labels update in real-time without cluttering the chart—old elements are automatically cleaned up.
- Extension Handling: Lines extend 2 bars ahead by default, adjustable if needed via code modifications.
How to Use
1. Add to Chart**: Copy the script into TradingView's Pine Editor, save, and add it to your chart.
2. Customize Timeframe: In the indicator settings, select your desired timeframe (default: 1D). This pulls levels from the previous period of that timeframe.
3. Interpret Levels:
- Use PDH/PDL as potential resistance/support zones.
- PDO/PDC can highlight session biases (e.g., gap fills or continuation patterns).
- Ideal for day trading, swing setups, or aligning with higher timeframe context.
4. Best Practices: Works on any market (stocks, forex, crypto). Combine with volume or momentum indicators for confluence.
Settings
- Timeframe: Dropdown with options: 5m, 10m, 15m, 30m, 45m, 1H, 2H, 3H, 4H, 1D, 1W, 1M.
- No other inputs for simplicity—colors, styles, and extensions are hardcoded for a clean default look. Edit the script to tweak (e.g., line colors or extension length).
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.