OPEN-SOURCE SCRIPT
已更新 Time Period Highlighter V2

This indicator highlights custom time periods on any intraday chart in TradingView, making it easier to visualize your preferred trading sessions.
You can define up to three separate time ranges per day, each with precise start and end times down to the minute (e.g., 08:30 - 12:15, 14:00 - 16:45, and 20:00 - 22:30). The indicator shades the background of your chart during these periods, helping you quickly identify when you're most active or when specific market conditions occur.
Key Features:
Set start and end times (hours and minutes) for up to three trading sessions.
Automatically highlights these periods across any intraday timeframe.
Uses 24-hour time format aligned with your TradingView chart timezone.
Perfect for day traders, scalpers, or anyone needing clear visual cues for their trading windows.
This tool is especially useful for reviewing trading strategies, backtesting, or ensuring you're focusing on high-probability market hours.
Tip: Double-check that your chart timezone matches your desired session times for accurate highlighting.
You can define up to three separate time ranges per day, each with precise start and end times down to the minute (e.g., 08:30 - 12:15, 14:00 - 16:45, and 20:00 - 22:30). The indicator shades the background of your chart during these periods, helping you quickly identify when you're most active or when specific market conditions occur.
Key Features:
Set start and end times (hours and minutes) for up to three trading sessions.
Automatically highlights these periods across any intraday timeframe.
Uses 24-hour time format aligned with your TradingView chart timezone.
Perfect for day traders, scalpers, or anyone needing clear visual cues for their trading windows.
This tool is especially useful for reviewing trading strategies, backtesting, or ensuring you're focusing on high-probability market hours.
Tip: Double-check that your chart timezone matches your desired session times for accurate highlighting.
發行說明
UPDATED:⚡️Time Period Highlighter V3 – DescriptionThis TradingView Pine Script highlights three major trading sessions on your chart using user-defined open and close times in local timezones:
✨ What it Does:
✅ Highlights New York, London, and Hong Kong trading sessions using distinct background colors.
✅ Lets you customize:
Session visibility (on/off)
Open/close time (hour + minute)
Session color
✅ Automatically adapts to your chart’s timeframe and applies accurate timezone conversions.
✅ Displays labels at the session start and end:
Open label placed at the low of the session's first candle.
Close label placed at the high of the session's last candle.
🔴 IMPORTANT NOTE:
⚠️ THIS SCRIPT DOES NOT WORK CORRECTLY ABOVE 30-MINUTE TIMEFRAME!
Session open/close labels may not appear due to resolution mismatches on higher timeframes.
發行說明
### ⚡️ **Time Period Highlighter V3 – Session Visualizer**
This TradingView indicator highlights the **New York**, **London**, and **Hong Kong** trading sessions with fully customizable **time, color, and labels**.
---
### ✨ **Features:**
* ✅ Highlights each session with a distinct background color
* ✅ Shows **Open** and **Close** labels (e.g. “NY Open”, “HK Close”)
* ✅ Timezone-adjusted using correct local times
* ✅ Great for **manual backtesting** and identifying session behavior
---
### ⚠️ **IMPORTANT USAGE NOTE**
> 🚫 **WORKS ONLY ON TIMEFRAMES BELOW 30 MINUTES**
> 🕒 If you use this script on ** 1h, 4h, etc.**, **labels may not appear** because session start/end may not match any candle.
---
### ✅ **WORKAROUND for Higher Timeframes**
To make it work above 30 minutes, use **round session start/end times**.
Example: Instead of `09:30 – 16:00`, use `10:00 – 16:00`.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。