AllTick
-
Hong Kong Stocks stock market datastock api AllTickFintechTrading Hours

Hong Kong Stock Market Data: Understanding Trading Sessions and Market Holidays

Understand HKEX trading sessions, 2026 market holidays, and half-day schedules to build more reliable Hong Kong stock monitoring applications with AllTick market data.

AllTick5 min read

A Hong Kong stock monitoring application may stop receiving price updates at 12:15 p.m., even though its WebSocket connection is still active. Should the application reconnect, or is the market simply following its normal trading schedule?

For fintech developers building stock dashboards, watchlists, and automated market-monitoring systems, this distinction matters. An application that treats every period without price updates as a connection failure can generate unnecessary alerts, repeatedly reconnect to healthy streams, and misrepresent the latest available market data.

Understanding Hong Kong Stock Market Data requires more than knowing when the exchange opens and closes. Developers also need to account for auction sessions, extended morning trading, market holidays, and half-day schedules.

The Hong Kong Stock Exchange (HKEX) trading calendar provides the foundation for handling these conditions correctly.

Understanding HKEX Trading Sessions

The Hong Kong securities market generally operates from Monday to Friday, excluding designated public holidays. Unlike a market with one continuous trading window, HKEX divides its trading day into several sessions.

All times below are Hong Kong Time (HKT, UTC+8).

Trading SessionHKEX Trading HoursMarket Activity
Pre-opening Session09:00–09:30Order input and opening price discovery
Morning Session09:30–12:00Continuous trading
Extended Morning Session12:00–13:00Extended trading for eligible securities
Afternoon Session13:00–16:00Continuous trading
Closing Auction Session16:00–16:10Closing price determination

The pre-opening session is an auction-based process rather than ordinary continuous trading. It includes order input, a no-cancellation period, random order matching, and a blocking period before continuous trading begins at 9:30 a.m.

The morning session runs until noon. The Extended Morning Session continues until 1:00 p.m., but it is available only to securities designated by HKEX as eligible for extended trading. Applications should not assume that every Hong Kong-listed stock can trade during this period.

Regular afternoon trading resumes at 1:00 p.m. and ends at 4:00 p.m. However, the end of continuous trading does not necessarily mean the entire market process is finished.

During the Closing Auction Session (CAS), eligible securities go through a closing-price determination process. The session begins at 4:00 p.m. and ends at a randomly determined time between 4:08 p.m. and 4:10 p.m.

The CAS includes reference price fixing, order input, a no-cancellation period, and random closing. Developers should distinguish auction activity from continuous trading when processing price updates and displaying market status.

For the official session definitions and trading arrangements, refer to the HKEX securities market trading hours.

Hong Kong Market Holidays and Half-Day Trading in 2026

Trading schedules alone are not sufficient for determining whether a Hong Kong stock should be receiving updates. The application must also know whether the exchange is open on a particular date.

HKEX publishes an annual securities market holiday schedule. According to its official 2026 calendar, the following dates are market holidays:

MonthHong Kong Market Holidays 2026
JanuaryJanuary 1
FebruaryFebruary 17–19
AprilApril 3, 6, 7
MayMay 1, 25
JuneJune 19
JulyJuly 1
OctoberOctober 1, 19
DecemberDecember 25

These dates cover the major exchange closures associated with Lunar New Year, Easter-related holidays, Labour Day, Tuen Ng Festival, National Day, and other Hong Kong public holidays. Saturdays and Sundays are also non-trading days.

Three additional dates require special handling:

  • February 16, 2026: Lunar New Year's Eve
  • December 24, 2026: Christmas Eve
  • December 31, 2026: New Year's Eve

These are half-day trading days, not full market holidays. The morning session operates as usual, but there is no Extended Morning Session or afternoon session. For securities covered by CAS, the Closing Auction Session takes place from noon to a random closing time between 12:08 p.m. and 12:10 p.m.

This difference is important for automated monitoring systems. A simple weekday check would incorrectly classify a half-day afternoon as an unexpected market interruption.

A production application should maintain separate records for full market holidays and half-day trading dates. The calendar should be refreshed whenever HKEX publishes its next annual schedule.

Developers can refer to the official HKEX 2026 securities market holiday schedule when maintaining their trading calendars.

How to Handle Trading Sessions in a Stock Monitoring Application

Consider a dashboard monitoring Tencent Holdings (700.HK). During active trading, the application receives price updates through its market-data connection. At other times, the absence of new transactions may be completely normal.

Instead of relying on incoming messages alone, the application should maintain a market-session state.

For example:

  • PRE_OPEN: HKEX is conducting its opening auction.
  • MORNING_CONTINUOUS: Morning trading is active.
  • EXTENDED_MORNING: The security is eligible for extended morning trading.
  • MIDDAY_BREAK: No applicable trading session is scheduled for that security.
  • AFTERNOON_CONTINUOUS: Afternoon trading is active.
  • CAS_WINDOW: The time falls within the scheduled Closing Auction Session window.
  • MARKET_HOLIDAY: The exchange is closed for a scheduled holiday.

The following Python example demonstrates how to classify the 2026 Hong Kong trading calendar.

text
from datetime import date, datetime, time
from zoneinfo import ZoneInfo

HK_TZ = ZoneInfo("Asia/Hong_Kong")

# Official HKEX securities market holidays for 2026
HKEX_HOLIDAYS_2026 = {
    date(2026, 1, 1),
    date(2026, 2, 17),
    date(2026, 2, 18),
    date(2026, 2, 19),
    date(2026, 4, 3),
    date(2026, 4, 6),
    date(2026, 4, 7),
    date(2026, 5, 1),
    date(2026, 5, 25),
    date(2026, 6, 19),
    date(2026, 7, 1),
    date(2026, 10, 1),
    date(2026, 10, 19),
    date(2026, 12, 25),
}

# Official 2026 half-day trading dates
HKEX_HALF_DAYS_2026 = {
    date(2026, 2, 16),
    date(2026, 12, 24),
    date(2026, 12, 31),
}


def get_hkex_session(
    now,
    extended_morning_eligible=False,
    cas_eligible=False
):
    if now.tzinfo is None or now.utcoffset() is None:
        raise ValueError("A timezone-aware datetime is required")

    local_time = now.astimezone(HK_TZ)
    trading_date = local_time.date()
    current_time = local_time.time().replace(tzinfo=None)

    # This example intentionally covers 2026 only.
    # Load the appropriate HKEX calendar for other years.
    if trading_date.year != 2026:
        raise ValueError("Please load the correct annual HKEX calendar")

    if trading_date.weekday() >= 5:
        return "WEEKEND"

    if trading_date in HKEX_HOLIDAYS_2026:
        return "MARKET_HOLIDAY"

    half_day = trading_date in HKEX_HALF_DAYS_2026

    if time(9, 0) <= current_time < time(9, 30):
        return "PRE_OPEN"

    if time(9, 30) <= current_time < time(12, 0):
        return "MORNING_CONTINUOUS"

    if half_day:
        if (
            cas_eligible
            and time(12, 0) <= current_time < time(12, 10)
        ):
            return "CAS_WINDOW"

        return "OUTSIDE_SESSION"

    if time(12, 0) <= current_time < time(13, 0):
        if extended_morning_eligible:
            return "EXTENDED_MORNING"

        return "MIDDAY_BREAK"

    if time(13, 0) <= current_time < time(16, 0):
        return "AFTERNOON_CONTINUOUS"

    if (
        cas_eligible
        and time(16, 0) <= current_time < time(16, 10)
    ):
        return "CAS_WINDOW"

    return "OUTSIDE_SESSION"


now = datetime.now(HK_TZ)

session = get_hkex_session(
    now,
    extended_morning_eligible=False,
    cas_eligible=True
)

print("Hong Kong Market Session:", session)

The code demonstrates three important practices: converting timestamps into Hong Kong local time, checking the exchange holiday calendar before classifying a session, and treating half-day trading separately from a normal trading day.

For the Tencent example, extended morning eligibility is set to False rather than assumed. The Extended Morning Session applies only to securities designated by HKEX as Extended Trading Securities. The eligibility setting should be determined from the applicable exchange rules and security list.

The CAS_WINDOW result identifies the scheduled time window for the Closing Auction Session. It does not confirm that the auction remains active throughout the entire window, because the actual closing time is randomized and may occur before 4:10 p.m. on a full trading day or 12:10 p.m. on a half-day. An application that needs the exact closing status must obtain that information from an appropriate exchange-status source.

This is a 2026 reference implementation rather than a complete production exchange calendar. A production system should load updated annual holidays, verify security-specific trading arrangements, and account for exceptional exchange announcements, severe-weather arrangements, and individual trading suspensions.

Integrating AllTick Hong Kong Stock Market Data

Once the market calendar is handled correctly, the next challenge is obtaining the price information that powers the application.

For developers building a Hong Kong stock watchlist or monitoring dashboard, AllTick Stock API provides access to Hong Kong, US, and A-share market data, including stock trades, quotes, and historical K-line information.

Consider a dashboard monitoring Tencent Holdings. Its instrument code is 700.HK. An application can use REST API requests to retrieve historical K-line data when initializing a chart or restoring the last available market information.

For example, the following request retrieves the latest two one-minute K-lines:

text
import json
import os
import requests
from urllib.parse import quote

API_KEY = os.environ["ALLTICK_API_KEY"]

query_data = {
    "trace": "hk-market-example",
    "data": {
        "code": "700.HK",
        "kline_type": 1,
        "kline_timestamp_end": 0,
        "query_kline_num": 2,
        "adjust_type": 0
    }
}

base_url = (
    "https://quote.alltick.co/quote-stock-b-api/v1/kline/"
)

encoded_query = quote(
    json.dumps(query_data, separators=(",", ":")),
    safe=""
)

response = requests.get(
    base_url + encoded_query,
    headers={"X-API-Key": API_KEY},
    timeout=10
)

response.raise_for_status()

result = response.json()

if result.get("ret") != 200:
    raise RuntimeError(f"AllTick API error: {result}")

print(result["data"])

Here, kline_type: 1 represents a one-minute K-line, while query_kline_num: 2 requests two records. The request uses the Hong Kong stock API base and the X-API-Key authentication header.

This example uses AllTick's REST API to retrieve historical K-line data. It retrieves K-line records rather than a continuous stream of live Tick updates. For a dashboard that needs continuously updated prices, a WebSocket subscription is the more appropriate data-delivery approach.

There is also an important distinction between a data API and an exchange calendar. AllTick's published REST API includes trading suspension and resumption interfaces for SSE, NYSE, and NASDAQ, but those interfaces should not be treated as an HKEX holiday calendar. Developers should maintain the Hong Kong exchange schedule separately instead of assuming that a successful API connection confirms an active trading session.

A reliable monitoring workflow therefore combines three independent pieces of information: the HKEX trading calendar, instrument-specific session rules, and the latest market data received from AllTick.

When the market is closed, the application can retain the last available price and its timestamp. During a scheduled break, it can suppress unnecessary connection alerts. When a session should be active but updates stop unexpectedly, the system can then investigate the WebSocket connection, subscription state, and data-delivery path.

For developers building Hong Kong stock applications, this separation makes market monitoring more predictable and avoids confusing normal exchange inactivity with technical failures.

Start integrating Hong Kong stock quotes and historical market data through the AllTick Stock API connection endpoint. Combine the data feed with an independently maintained HKEX calendar to build a more reliable stock monitoring experience.

Start streaming market data today

Generate a free API key in seconds and connect to every market from one endpoint.