OPEN-SOURCE SCRIPT
已更新 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.
版本注释
update with clean chart.版本注释
Bug Fix版本注释
Bug Fix版本注释
Bug Fix 3.6版本注释
Correction and fix.版本注释
Fix Bugs.版本注释
Fix Time Bugs.版本注释
fix time版本注释
### **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. 🚀
版本注释
Fix NY status版本注释
Fix UTC bugs版本注释
FIX UTC Bugs版本注释
Fix版本注释
Fix版本注释
Fiz UTC版本注释
FIX US UTC版本注释
fix us utc版本注释
Fix Several Bugs.版本注释
Fix de Summer time zone版本注释
🟨 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.
版本注释
Fix image版本注释
✅ 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
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。