OPEN-SOURCE SCRIPT

Live Clock + Trading Sessions | DST Auto | Countdown

777
A real-time clock, trading session detector, and bar countdown timer — all in one lightweight overlay. Designed for traders who need to track market hours across multiple time zones without switching tabs or doing mental math.

─────────────────────────────────────────
🕐 WHAT IT DOES
─────────────────────────────────────────

The indicator displays a compact information panel on your chart with up to two rows:

Row 1 — Clock: GMT: 14:32:07
Row 2 — Countdown: Countdown: 12:44

The label on Row 1 switches automatically based on which mode you choose:

• Timezone mode → shows your selected timezone prefix (e.g. "UTC: 14:32:07")
• Session mode → shows the active trading session name (e.g. "London: 09:32:07")

─────────────────────────────────────────
📊 TRADING SESSION DETECTION
─────────────────────────────────────────

When set to Trading Session mode, the indicator automatically detects which Forex / equity session is currently open, using each exchange's local time:

🔵 Sydney — 10:00–19:00 AEST / AEDT
🟠 Asia — 09:00–18:00 JST (Tokyo, no DST)
🔵 London — 08:00–17:00 GMT / BST
🟢 New York — 09:30–17:00 EST / EDT

When two sessions overlap, the label updates to reflect the combined window:

🟡 London/NY — the most liquid window of the trading day
🟡 Asia/London — early European session with Asian carry-over
🟡 Tokyo/Sydney — early Asian open overlap

When all sessions are closed, the panel shows "Off-Hours" in gray so you always know where you stand.

─────────────────────────────────────────
⏰ AUTOMATIC DAYLIGHT SAVING TIME (DST)
─────────────────────────────────────────

DST is handled entirely automatically — no manual adjustment, no seasonal settings to change.

The indicator uses IANA timezone identifiers (the same database your operating system uses) so that "8 AM London" always means 8 AM London time, whether the UK is on GMT (winter) or BST (summer). The same applies to New York (EST ↔ EDT) and Sydney (AEST ↔ AEDT). Tokyo has no DST and is always consistent.

You never need to touch a setting when clocks change.

─────────────────────────────────────────
⏱ BAR COUNTDOWN TIMER
─────────────────────────────────────────

A second row shows the exact time remaining until the current candle closes:

• Short timeframes (< 1 hour): MM:SS → e.g. Countdown: 12:44
• Long timeframes (≥ 1 hour): H:MM:SS → e.g. Countdown: 1:45:10

Works on every timeframe — 1m, 5m, 15m, 1h, 4h, Daily, and beyond. Can be toggled off if you prefer a single-row display.

─────────────────────────────────────────
⚙️ SETTINGS OVERVIEW
─────────────────────────────────────────

⏰ Clock
• Label Mode — "Timezone" or "Trading Session"
• Timezone — choose from 25 time zones (active in Timezone mode)
• 24-Hour Format — toggle 24h / 12h AM-PM display
• Show Seconds — show or hide the seconds digit
• Show Date — prepend the date (e.g. "03 Jun 2026 | London: 09:32:07")
• Show Countdown — toggle the bar countdown row on or off

📊 Trading Sessions
• Enable / disable each session individually (Sydney, Tokyo, London, New York)
• Disabling a session removes it from detection and overlap logic entirely

🎨 Style
• Position — 8 placements: all four corners, top/bottom center, left/right middle
• Background — color and opacity
• Text size — Tiny / Small / Normal / Large / Huge
• Clock color — used in Timezone mode and for Off-Hours
• Countdown color — independent color for the countdown row
• Per-session colors — assign a distinct color to each session and to overlaps
(defaults: Cyan = Sydney, Orange = Asia, Blue = London,
Green = New York, Yellow = any overlap, Gray = Off-Hours)

─────────────────────────────────────────
📌 HOW TO USE
─────────────────────────────────────────

1. Add the indicator to any chart via the Indicators menu.
2. Open Settings (⚙️ icon on the indicator) and choose your Label Mode.

For Timezone mode:
• Pick your local timezone from the Timezone dropdown.
• The clock will always show the current time in that zone.

For Trading Session mode:
• No timezone selection needed — the clock automatically shows the
local time of whatever session is currently open.
• Colors change as sessions open and close, giving you an at-a-glance
view of current market activity.

3. Adjust Position, size, and colors to suit your chart layout.
4. Toggle Show Countdown on or off depending on whether you track bar close timing.

─────────────────────────────────────────
💡 TIPS
─────────────────────────────────────────

• The London/NY overlap (typically 13:00–17:00 UTC) highlights the highest-
liquidity window of the Forex day — useful for breakout and momentum traders.

• Pair with a clean chart layout: place the panel in a corner that does not
overlap your price action or other indicators.

• The countdown timer updates on each new tick, so it is most precise on
liquid instruments (major Forex pairs, index futures, crypto).

• The date row is useful on higher timeframes (4H, Daily) when you want
to confirm the current session date across time zones.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。