OPEN-SOURCE SCRIPT
Updated World Digital Clock

Original code developed by br.tradingview.com/u/you_222/
In this update I added the Frankfurt stock exchange, left the times according to Western Europe, and added another light signal to identify whether the stock exchange is open or closed.
This indicator provides a digital clock and real-time status for major financial markets, including Tokyo, London, New York, and Frankfurt. It displays whether each market is currently OPEN or CLOSED, along with the time remaining until the market opens or closes. The indicator is designed to keep traders informed about market activity at a glance.
Key Features:
Digital Clock:
Displays the current time based on a user-defined UTC offset.
Customizable text color, size, and background color.
Market Status:
Shows whether each major market is OPEN or CLOSED.
Displays a countdown timer indicating the time remaining until the market opens or closes.
Includes markets for Tokyo, London, New York, and Frankfurt.
Color Indicators:
A green dot indicates the market is open.
A red dot indicates the market is closed.
Text colors for open and closed markets can be customized.
Customizable Layout:
Choose the table position on the chart (e.g., top right, bottom left).
Adjust text sizes for both the clock and market status.
Daylight Saving Time:
Automatically adjusts market opening and closing times based on daylight saving rules (e.g., summer and winter time).
Alerts:
Optionally triggers alerts when a market opens, keeping you updated in real-time.
Use Cases:
Perfect for day traders or swing traders who need to monitor global market activity.
Useful for keeping track of trading hours and planning strategies based on market availability.
Helps avoid trading outside active market hours, reducing slippage and volatility risks.
This versatile and customizable tool ensures you're always aware of market status and time zones, enhancing your trading efficiency and decision-making.
In this update I added the Frankfurt stock exchange, left the times according to Western Europe, and added another light signal to identify whether the stock exchange is open or closed.
This indicator provides a digital clock and real-time status for major financial markets, including Tokyo, London, New York, and Frankfurt. It displays whether each market is currently OPEN or CLOSED, along with the time remaining until the market opens or closes. The indicator is designed to keep traders informed about market activity at a glance.
Key Features:
Digital Clock:
Displays the current time based on a user-defined UTC offset.
Customizable text color, size, and background color.
Market Status:
Shows whether each major market is OPEN or CLOSED.
Displays a countdown timer indicating the time remaining until the market opens or closes.
Includes markets for Tokyo, London, New York, and Frankfurt.
Color Indicators:
A green dot indicates the market is open.
A red dot indicates the market is closed.
Text colors for open and closed markets can be customized.
Customizable Layout:
Choose the table position on the chart (e.g., top right, bottom left).
Adjust text sizes for both the clock and market status.
Daylight Saving Time:
Automatically adjusts market opening and closing times based on daylight saving rules (e.g., summer and winter time).
Alerts:
Optionally triggers alerts when a market opens, keeping you updated in real-time.
Use Cases:
Perfect for day traders or swing traders who need to monitor global market activity.
Useful for keeping track of trading hours and planning strategies based on market availability.
Helps avoid trading outside active market hours, reducing slippage and volatility risks.
This versatile and customizable tool ensures you're always aware of market status and time zones, enhancing your trading efficiency and decision-making.
Release Notes
update with clean chart.Release Notes
Bug FixRelease Notes
Bug FixRelease Notes
Bug Fix 3.6Release Notes
Correction and fix.Release Notes
Fix Bugs.Release Notes
Fix Time Bugs.Release Notes
fix timeRelease Notes
### **Summary of Modifications**1. **Added Precise Market Hours**
- Adjusted **New York opening time** to support half-hour increments correctly (**15.5 instead of 15.30**).
- Implemented **daylight saving time adjustments** for each market.
2. **Improved Market Time Display**
- Replaced **time remaining** with **current local time** for each market.
- Now displays **HH:MM:SS** format for accuracy.
3. **Refined Market Status Colors**
- Restored **original green** for open markets (**#00aa00** instead of a brighter green).
- Kept **red** for closed markets (**#ff0000**).
4. **Enhanced Visual Indicators**
- **Added a colored dot** before the market name to indicate status.
- Ensured proper positioning and formatting for **better readability**.
These updates improve **accuracy, clarity, and usability** of the trading session dashboard. 🚀
Release Notes
Fix NY statusRelease Notes
Fix UTC bugsRelease Notes
FIX UTC BugsRelease Notes
FixRelease Notes
FixRelease Notes
Fiz UTCRelease Notes
FIX US UTCRelease Notes
fix us utcRelease Notes
Fix Several Bugs.Release Notes
Fix de Summer time zoneRelease Notes
🟨 Feature Update: Pre-Open and Pre-Close Highlighting (Yellow Warning Color)This update enhances the market clock indicator by adding a "warning zone" that visually alerts the user when a market is about to open or close within the next 15 minutes.
✅ What’s New:
If the current time is within 15 minutes (i.e. 0.25 hours) before a market opens or closes, the market status text will turn yellow.
This applies to all markets individually (e.g., Tokyo, London, New York, Frankfurt).
Once the market opens or closes, the color changes back to green (open) or red (closed), as usual.
🔧 How It Works:
In the get_market_status() function:
We calculate the current time in decimal hours.
We check two new conditions:
is_opening_soon: true if the time is between open_hour - 0.25 and open_hour.
is_closing_soon: true if the time is between close_hour - 0.25 and close_hour.
If either condition is true, the status color is set to yellow (color.yellow).
This makes the dashboard more informative and helps traders prepare just before the market opens or closes.
Release Notes
Fix imageRelease Notes
✅ Key Updates:🕒 1. Configurable Main Clock (UTC Offset)
The main digital clock now allows manual UTC offset input.
By default, it's set to UTC+2, corresponding to Germany/Luxembourg during Daylight Saving Time (DST).
🟡 2. Visual Yellow Warning (⚠️)
When a market is about to open or close within the next 15 minutes, its status turns yellow.
This gives you a visual cue to prepare for potential volatility.
🔔 3. Sound Alert 5 Minutes Before
A sound alert is triggered via the alert() function when 5 minutes remain before a market opens or closes.
You can enable these alerts in the TradingView alert settings.
Great for preparing entries, exits, or managing pending orders.
🌍 4. Accurate Daylight Saving Time (DST) Detection
The script detects whether each market is in daylight saving time:
New York: 2nd Sunday of March to 1st Sunday of November
London & Frankfurt: Last Sunday of March to last Sunday of October
Tokyo: No DST (always UTC+9)
🧼 5. Clean & Optimized Code
Improved variable naming (display_text instead of reserved text)
Modular logic using reusable functions
Consistent and modern visual layout
📌 Markets Tracked:
Tokyo
London
New York
Frankfurt
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.