OPEN-SOURCE SCRIPT
Mis à jour 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.
Notes de version
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.
Notes de version
### ⚡️ **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`.
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.