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).
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。