What Market Hours Panel does
Market Hours Panel is a free indicator by DinexSpace for MT5 and TradingView. Shows whether six major exchanges are open, on lunch break or closed, and how long until the next change.
MT5 version
Market Hours Panel shows the trading hours of six major stock exchanges in one small panel: New York (NYSE/Nasdaq), London (LSE), Frankfurt (Xetra), Tokyo (TSE), Hong Kong (HKEX) and Sydney (ASX). Index and stock CFDs often move differently while their home exchange is open, so it helps to know at a glance which ones are trading.
TradingView version
Market Hours Panel shows the trading hours of six major stock exchanges in one table: New York (NYSE/Nasdaq), London (LSE), Frankfurt (Xetra), Tokyo (TSE), Hong Kong (HKEX) and Sydney (ASX). Index, stock and many CFD prices move differently when their home exchange is open, so it helps to know at a glance which ones are trading.
When to use it
Use it when you trade indices and stocks.
Features and modes
Market Hours Panel has 10 documented features, listed below.
MT5 version
How it works
- Hours are entered in each exchange's local time. Daylight saving in the US, UK, Europe and Australia is calculated automatically from UTC, so the panel stays correct all year whatever your broker's server time is.
- Tokyo and Hong Kong have a lunch break; during it the panel shows "Lunch".
- For each exchange the panel shows the status (Open, Lunch or Closed), the time until it closes or next opens, and the local time there.
- Saturdays and Sundays are closed.
- The panel updates every second from the computer's UTC clock, so it keeps counting even without new ticks.
Default hours (local time) New York 09:30–16:00 · London 08:00–16:30 · Frankfurt 09:00–17:30 · Tokyo 09:00–15:30 (lunch 11:30–12:30) · Hong Kong 09:30–16:00 (lunch 12:00–13:00) · Sydney 10:00–16:00.
TradingView version
How it works
- Each exchange's hours are entered in its own local time, so daylight-saving changes in the US, UK, Europe and Australia are handled automatically.
- Tokyo and Hong Kong include their lunch break as a second range. The table then shows "Lunch" instead of "Open".
- For every exchange the table shows the status (Open, Lunch or Closed), the time until it closes or next opens, and the current local time there.
- Saturdays and Sundays are treated as closed.
- You can turn each exchange on or off, and edit its hours if they change.
Default hours (local time) New York 09:30–16:00 · London 08:00–16:30 · Frankfurt 09:00–17:30 · Tokyo 09:00–11:30 and 12:30–15:30 · Hong Kong 09:30–12:00 and 13:00–16:00 · Sydney 10:00–16:00.
Parameters
Market Hours Panel has 24 inputs in the MT5 version and 8 in the TradingView version; every input and its default is listed below.
MT5 version
- Exchanges: on/off, open and close for each, plus lunch start and end for Tokyo and Hong Kong.
- Display: font size, panel corner.
TradingView version
- Exchanges: on/off and hours for each (one range, or two ranges separated by a comma).
- Display: table position and text size.
| Input | Default | Label in MT5 |
|---|---|---|
| Exchanges (local hours HHMM; lunch = 0 if none) | ||
InpNY | true | New York (NYSE/Nasdaq) |
InpNYo | 930 | New York open |
InpNYc | 1600 | New York close |
InpLN | true | London (LSE) |
InpLNo | 800 | London open |
InpLNc | 1630 | London close |
InpFR | true | Frankfurt (Xetra) |
InpFRo | 900 | Frankfurt open |
InpFRc | 1730 | Frankfurt close |
InpTK | true | Tokyo (TSE) |
InpTKo | 900 | Tokyo open |
InpTKls | 1130 | Tokyo lunch start |
InpTKle | 1230 | Tokyo lunch end |
InpTKc | 1530 | Tokyo close |
InpHK | true | Hong Kong (HKEX) |
InpHKo | 930 | Hong Kong open |
InpHKls | 1200 | Hong Kong lunch start |
InpHKle | 1300 | Hong Kong lunch end |
InpHKc | 1600 | Hong Kong close |
InpSY | true | Sydney (ASX) |
InpSYo | 1000 | Sydney open |
InpSYc | 1600 | Sydney close |
| Display | ||
InpFont | 9 | Font size |
InpCorner | CORNER_RIGHT_UPPER | Panel corner |
| Input | Default |
|---|---|
| Exchanges (local hours, HHMM-HHMM[,HHMM-HHMM]) | |
| New York (NYSE/Nasdaq) | true |
| London (LSE) | true |
| Frankfurt (Xetra) | true |
| Tokyo (TSE) | true |
| Hong Kong (HKEX) | true |
| Sydney (ASX) | true |
| Display | |
| Table position | "Top right" |
| Text size | "Small" |
Signals
Market Hours Panel does not generate buy or sell signals. It is an analysis tool: you read what it plots and make your own decisions.
Alerts
No. Market Hours Panel has no built-in alerts.
Buffers for Expert Advisors
No. Market Hours Panel draws chart objects (lines, boxes, labels or a panel) and has no indicator buffers for EAs.
Timeframes and markets
Market Hours Panel sets no timeframe limit in its code: it runs on any chart timeframe and on the symbol of the chart it is attached to.
Limitations
Market Hours Panel is an analysis tool, not a trading system. Its documented limitations are listed below.
MT5 version
- Public holidays and early closes are not included.
- The countdown relies on the computer's clock being correct.
- It only shows times. It does not draw on the chart or give trade signals.
The indicator does not trade and uses no DLLs or web requests.
TradingView version
- Public holidays and early closes are not included.
- TradingView runs scripts on price ticks, so on a quiet chart the countdown can pause between ticks.
- It only shows times. It does not give trade signals.
This script is a timing aid only. It does not give trade signals or investment advice.
Pine Script code
Paste the whole script into the Pine Editor on TradingView.
market_hours_panel.pine · 111 lines//@version=6
// DinexSpace | Market Hours Panel
// Opening hours of six major stock exchanges (New York, London, Frankfurt, Tokyo, Hong Kong, Sydney) in one
// table: open or closed right now, lunch breaks, and the time until the next open or close. Hours are set in
// each exchange's own time zone, so daylight saving is handled. Weekends are closed; holidays are not included.
// Free and open source. License: MIT. (c) 2026 DinexSpace
indicator("DinexSpace | Market Hours Panel", shorttitle = "DNX Market Hours", overlay = true)
// ===== Brand colours =====
C_GREEN = #00FF7F // SpringGreen: open
C_AQUA = #00FFFF // Aqua: countdown to open
C_AMBER = #FFB000 // lunch break
C_GRAY = #9AA0A6
// ===== Inputs: exchanges (hours in local time; a lunch break is a second range after a comma) =====
GRP_X = "Exchanges (local hours, HHMM-HHMM[,HHMM-HHMM])"
use1 = input.bool(true, "New York (NYSE/Nasdaq)", inline = "1", group = GRP_X)
h1 = input.string("0930-1600", "", inline = "1", group = GRP_X)
use2 = input.bool(true, "London (LSE)", inline = "2", group = GRP_X)
h2 = input.string("0800-1630", "", inline = "2", group = GRP_X)
use3 = input.bool(true, "Frankfurt (Xetra)", inline = "3", group = GRP_X)
h3 = input.string("0900-1730", "", inline = "3", group = GRP_X)
use4 = input.bool(true, "Tokyo (TSE)", inline = "4", group = GRP_X)
h4 = input.string("0900-1130,1230-1530", "", inline = "4", group = GRP_X)
use5 = input.bool(true, "Hong Kong (HKEX)", inline = "5", group = GRP_X)
h5 = input.string("0930-1200,1300-1600", "", inline = "5", group = GRP_X)
use6 = input.bool(true, "Sydney (ASX)", inline = "6", group = GRP_X)
h6 = input.string("1000-1600", "", inline = "6", group = GRP_X)
GRP_D = "Display"
tblPos = input.string("Top right", "Table position", options = ["Top right", "Top left", "Bottom right", "Bottom left"], group = GRP_D)
tsz = input.string("Small", "Text size", options = ["Tiny", "Small", "Normal"], group = GRP_D)
string ts = tsz == "Tiny" ? size.tiny : tsz == "Normal" ? size.normal : size.small
fmt(int ms) =>
int m = int(math.floor(ms / 60000))
int d = int(math.floor(m / 1440))
int h = int(math.floor((m % 1440) / 60))
int mm = m % 60
d > 0 ? str.format("{0}d {1}h", d, str.tostring(h, "00")) : h > 0 ? str.format("{0}h {1}m", h, str.tostring(mm, "00")) : str.format("{0}m", mm)
// State of an exchange at `now`: [status 0 closed / 1 open / 2 lunch, ms until the next change].
// `hours` holds one or two "HHMM-HHMM" ranges in time zone `tz`; weekends are closed.
state(string hours, string tz, int now) =>
array<string> ranges = str.split(hours, ",")
int y = year(now, tz)
int mo = month(now, tz)
int dd = dayofmonth(now, tz)
int status = 0
int nextChange = na
for off = 0 to 7
int day0 = timestamp(tz, y, mo, dd + off, 0, 0)
int dow = dayofweek(day0, tz)
if dow == dayofweek.saturday or dow == dayofweek.sunday
continue
for [i, r] in ranges
string s = str.trim(r)
if str.length(s) >= 9
int a = timestamp(tz, y, mo, dd + off, int(str.tonumber(str.substring(s, 0, 2))), int(str.tonumber(str.substring(s, 2, 4))))
int b = timestamp(tz, y, mo, dd + off, int(str.tonumber(str.substring(s, 5, 7))), int(str.tonumber(str.substring(s, 7, 9))))
if now >= a and now < b
status := 1
nextChange := b - now
else if off == 0 and i > 0 and status == 0 and now < a
// between two ranges of today = lunch break
string p = str.trim(ranges.get(i - 1))
int pe = timestamp(tz, y, mo, dd, int(str.tonumber(str.substring(p, 5, 7))), int(str.tonumber(str.substring(p, 7, 9))))
if now >= pe
status := 2
nextChange := a - now
if status == 0 and a > now and na(nextChange)
nextChange := a - now
if not na(nextChange)
break
[status, nextChange]
tPos = switch tblPos
"Top left" => position.top_left
"Bottom right" => position.bottom_right
"Bottom left" => position.bottom_left
=> position.top_right
var table tbl = table.new(tPos, 4, 9, bgcolor = color.new(color.black, 10), border_color = color.new(color.gray, 70), border_width = 1)
row(int r, bool use, string name, string hours, string tz) =>
if use
[st, ms] = state(hours, tz, timenow)
string s = st == 1 ? "Open" : st == 2 ? "Lunch" : "Closed"
color c = st == 1 ? C_GREEN : st == 2 ? C_AMBER : C_GRAY
string nx = na(ms) ? "-" : (st == 1 ? "closes " : "opens ") + fmt(ms)
table.cell(tbl, 0, r, name, text_color = color.white, text_size = ts, text_halign = text.align_left)
table.cell(tbl, 1, r, s, text_color = c, text_size = ts)
table.cell(tbl, 2, r, nx, text_color = st == 1 ? C_GREEN : C_AQUA, text_size = ts, text_halign = text.align_left)
table.cell(tbl, 3, r, str.format_time(timenow, "HH:mm", tz), text_color = C_GRAY, text_size = ts)
else
for c = 0 to 3
table.cell(tbl, c, r, "")
if barstate.islast
table.cell(tbl, 0, 0, "Exchange", text_color = color.gray, text_size = ts, text_halign = text.align_left)
table.cell(tbl, 1, 0, "Status", text_color = color.gray, text_size = ts)
table.cell(tbl, 2, 0, "Next change", text_color = color.gray, text_size = ts, text_halign = text.align_left)
table.cell(tbl, 3, 0, "Local", text_color = color.gray, text_size = ts)
row(1, use1, "New York", h1, "America/New_York")
row(2, use2, "London", h2, "Europe/London")
row(3, use3, "Frankfurt", h3, "Europe/Berlin")
row(4, use4, "Tokyo", h4, "Asia/Tokyo")
row(5, use5, "Hong Kong", h5, "Asia/Hong_Kong")
row(6, use6, "Sydney", h6, "Australia/Sydney")
table.cell(tbl, 0, 7, "Holidays not included", text_color = C_GRAY, text_size = size.tiny, text_halign = text.align_left)
table.cell(tbl, 0, 8, "DinexSpace", text_color = C_GREEN, text_size = size.tiny, text_halign = text.align_left)
Market Hours Panel FAQ
Market Hours Panel is free, runs on MT5 and TradingView and does not place trades.
Is Market Hours Panel free?
Yes. Market Hours Panel is free to download from this page with no sign-up, and the download includes the full source code.
Which platforms does Market Hours Panel run on?
Market Hours Panel is available for MetaTrader 5 (MQL5) and TradingView (Pine Script v6).
Does Market Hours Panel give buy and sell signals?
Market Hours Panel does not generate buy or sell signals. It is an analysis tool: you read what it plots and make your own decisions.
Does Market Hours Panel have alerts?
No. Market Hours Panel has no built-in alerts.
Can an EA read Market Hours Panel?
No. Market Hours Panel draws chart objects (lines, boxes, labels or a panel) and has no indicator buffers for EAs.
Which timeframes does Market Hours Panel work on?
Market Hours Panel sets no timeframe limit in its code: it runs on any chart timeframe and on the symbol of the chart it is attached to.
Does Market Hours Panel place trades?
No. It is a read-only indicator: it only reads market data and shows the result on the chart or writes it to a file. The source contains no calls that open, close or modify orders.
How do I install Market Hours Panel?
Download the .zip and follow the step-by-step installation guide for MT5 and TradingView: https://indicators.dinexspace.com/install-guide/
Measured win rates (backtest)
Filter / stop-trading tool: no arrows yet; new arrow rules approved, in progress.
- Costs: Real spread of an ECN-type MT5 account, no commission.
- Data source: MT5 tick data (BNB: Binance spot).
TradingView H4/D1 bars may follow the exchange time zone of the TradingView symbol, not the MT5 server time (UTC) used for the measurement; sessions and the H4 trend may differ on the Pine version. Same signals on TradingView not checked yet.
Past test statistics are not a promise of future results.