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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。