omd-c mmdh interface specifications · stock connect daily quota balance (80) and stock connect...

61
INTERFACE SPECIFICATIONS HKEX Orion Market Data Platform Mainland Market Data Hub Securities Market & Index Datafeed Products (OMD-C MMDH) Version:V1.29 4 Dec 2019 © Copyright 2019 HKEX All Rights Reserved

Upload: others

Post on 18-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

INTERFACE SPECIFICATIONS

HKEX Orion Market Data Platform

Mainland Market Data Hub

Securities Market & Index Datafeed Products

(OMD-C MMDH)

Version:V1.29

4 Dec 2019

© Copyright 2019 HKEX

All Rights Reserved

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 2/61

DOCUMENT HISTORY

Version Date of Issue Comments

v1.0 Nov 13, 2012 First Distribution Version – internal date 21st Nov 2012

v1.1 Dec 31, 2012

Revised Edition with the following updates: -Section 3.3.1: Additional notes on heartbeat added -Section 3.4.4: Added 3-byte filler -Section 3.10.1: Additional notes on the short sell field updates -Section 5.5 – Updated diagram -Appendix A: Added 1 new index and more information to the table

v1.2 May 24, 2013

Revised Edition with the following updates: - Section 1.3 – Message Formats column added - Section 3.1 – ASCII clarification added - Section 3.4.2 – Username field Description updated - Section 3.4.23 – Value “7” removed in 2nd bullet point and the table - Section 3.4.4 – Value “4” & “7” removed - Section 3.6.2 – Values column for field ‘UnderlyingSecurityWeight’ added with a note - Section 3.6.2 – Note (1) clarification added - Section 3.8.1 – 3.8.2 – Revise wordings for description of OrderID - Section 3.10.2 – Clarification added in the first paragraph - Section 3.10.2 – Values column of field “Currency Code” added with a note - Section 3.11.1 – Clarification on the second paragraph added - Section 4.2 – Revise snapshot description for Security Status - Section 5.7 – Phrase “6 consecutive unsuccessful logon attempts” in paragraph 1 removed - Sections related to Service Unavailable (previously 5.8 and 5.9) removed - Appendix A – Index table adjusted with 2 new indices and more content

v1.3 Aug 1, 2013

Revised Edition with the following updates: - 3.3.1 – Revised wording for description on sending heartbeat message - Section 4.2 – Clarification of order book for emptied books - Appendix A – CES China HK Mainland Index code adjusted

V1.4 Oct 11, 2013

Revised Edition with the following updates: - Section 2.2.2 – Updated system startup time - Section 3.9.3 – Add notes on Nominal Price - Section 3.10.1 – Add notes on trading statistics during auction session - Section 4.2 – Updated snapshot notes for market turnover

V1.5 Nov 28, 2013

Revised Edition with the following updates: - Section 3.9.3 – Updated note on Nominal Price - Section 3.10.2 – Clarification added in the first paragraph - Section 5.1 – Updated hyperlinks of the section numbers for Logon and Logon Response - Section 5.7 – Update note in paragraph 1

V1.5A Jun 30, 2014 Revised Edition with the following updates: - Appendix A – adding one new indices CES China 280 Index

V1.6 Jul 04, 2014

Revised Edition with the following updates: - Sections 1.1 and 1.4 - Add description and section for Scope of Information - Sections 2.1.2 - Add clarifications on Connection Options - Section 2.2 - Add notes on the possible test data transmission during non-production hours - Section 2.2.2 – Updated the OMD-C MMDH normal startup time from 2:00am to 6:00am - Sections 3.12, 3.12.1, 3.12.2 & Appendix A - Add information on new market information

(Northbound Daily Quota Balance) via IndexSource “C”

V1.7 Jul25, 2014 Revised Edition with the following updates:

- Sections 3.12.2 –Update the Note for Northbound Daily Quota Balance and add note to the value of IndexVolume field

V1.8 21 Nov 2014 Revised Edition with the following updates:

- Appendix A – adding two new indices CES Stock Connect Hong Kong Select 100 Index and CES Shanghai-Hong Kong Stock Connect 300 Index

V1.9 3 Feb 2015 Revised Edition with the following updates: - Section 3.12.1 – Add description for index definition dissemination

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 3/61

- Section 3.12.2 – Add note to IndexVolume field for Northbound Daily Quota Balance value

V1.10 19 May 2015 Revised Edition with the following updates: - Section 3.10.1 – Update description for Statistics (60) message

V1.10A 12 Aug 2015

Revised Edition with the following updates: - Section 3.8.2 – Typo Correction

- Appendix A – Update the index name “CSI HK Mainland Enterprises 50 Index” and add six new HSI indices

V1.11 5 Aug 2015

Revised Edition with the following updates:

Effective Date Changes

Phrase 1 of CAS on 25 Jul 2016 VCM on 22 Aug 2016

Introduction of Closing Auction Session (CAS) & Volatility Control Mechanism (VCM) - Section 1.3 – Add new messages Order Imbalance (56), Reference Price

(43), VCM Trigger (23) - Section 3.2 – Add New MsgType for Order Imbalance (56), Reference Price

(43), VCM Trigger (23) - Section 3.6.2 – Introduce two fields “VCM Flag” and “CAS Flag” in Securities

Definition - Section 3.7.1 – New field values for new trading sessions in CAS - Section 3.8.5 – Add new Order Imbalance (56) message - Section 3.9.4 – Revise description of Indicative Equilibrium Price (41)

message - Section 3.9.5 – Add new Reference Price (43) message - Section 3.9.6 – Add new VCM Trigger (23) message - Section 4.2 – Include Order Imbalance (56), Reference Price (43), VCM

Trigger (23) in refresh service

V1.11B 14 Dec 2015

Revised Edition with the following updates:

Effective Date Changes

Immediate Clarifications - Section 3.11.1 – Revise the description for Statistics (60) message to reflect

the change effective in mid 2015 that Statistics message will be sent after every trade including off-exchange trades reported during auction session

Phrase 1 of CAS on 25 Jul 2016

Other Enhancements - Section 3.6.2 – Format change to Security Definition (11) message to insert a

number of fillers inside the message - Section 3.6.2 – Add new possible value “O” for others for the data field

CallPutFlag in addition to the existing possible values “C” for Call and “P” for Put

V1.12 01 Mar 2016

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Section 3.7.2 – Rename the data field “SecurityTradingStatus” (at Offset#8) to “SuspensionIndicator” and revise its description

18 Apr 2016 Launch of new Index Appendix A – Add new index “CES Gaming Top 10 Index”

Phrase 1 of CAS on 25 Jul 2016

Clarifications

Section 3.9.5 – Revise description for Reference Price message

V1.13 10 May 2016

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Sections 3.7.1 and 3.9.6 – Revise descriptions for Time fields to align across the document

23 May 2016 Renaming of CES Shanghai-Hong Kong Stock Connect 300 Index

Appendix A – Rename “CES Shanghai-Hong Kong Stock Connect 300 Index” to “CES Stock Connect 300 Index”

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 4/61

V1.14 21 Jun 2016

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Sections 3.2 and 3.7.1 – Enhance descriptions to clarify Time fields

5 Dec 2016 Launch of Shenzhen - Hong Kong Stock Connect

Section 3.12.2 – Include Northbound Daily Quota Balances of Shenzhen Hong Kong Stock Connect

Appendix A - Add new market information for Northbound Daily Quota Balance of Shenzhen-Hong Kong Stock Connect

V1.15 04 Aug 2016

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Section 3.2 – Enhance descriptions for InternalSeqNum

Section 3.6.2 – Correct total length of message fields

Section 3.12.1 and 3.12.2 – Revise to clarify IndexCode, NetChgPrevDay and NetChgPrevDayPct

29 Aug 2016 Launch of new Indices

Sections 2.2.3 and 2.2.4 – Enhance to clarify descriptions

Section 3.1.2 – Add CNH

Section 3.12.1 – Add new IndexSource

Section 3.12.2 – Add TR under descriptions of PreviousSesClose

Appendix A – Add 4 new HKEX and Thomson Reuters co-branded indices

V1.16 24 Aug 2016

Revised Edition with the following updates

Effective Date Changes

29 Aug 2016 Launch of new Indices

Appendix A – HKEX and Thomson Reuters co-branded indices are listed as Third Party Content under the Licence Agreement

V1.17 03 Feb 2017

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications Section 3.10.2 – Revise description for Market Turnover message

Jun 2017 Launch of Stock Connect Market Feed

Section 1.3 – Include Stock Connect Data in Summary Table

Section 1.4 – Include Stock Connect Data in Scope of Information

Section 3.2 – Include Stock Connect Daily Quota Balance (80) and Stock Connect Market Turnover (81) in MsgType list

Section 3.13 – Introduce new messages on Stock Connect Data including Stock Connect Daily Quota Balance (80) and Stock Connect Market Turnover (81)

Section 4.2 - Include Stock Connect Data in Refresh Service

V1.18 27 Feb 2017

Revised Edition with the following updates

Effective Date Changes

1 Apr 2017 Removal of Index

Appendix A – Remove “H11124 – CSI Overseas Mainland Enterprises Index (HKD)”

V1.19 27 Mar 2017

Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Section 2.2.2 – Revise description to clarify Start of Day

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 5/61

V1.20 20 Oct 2017 Revised Edition with the following updates

Effective Date Changes

30 Oct 2017 Remove Daily Quota Balance (DQB) from Index

Section 3.12.2 – Remove all description related to “CSCSHQ Northbound Daily Quota Balance of Shanghai-Hong Kong Stock Connect” and “CSCSZQ Northbound Daily Quota Balance of Shenzhen-Hong Kong Stock Connect”

Appendix A – Remove “CSCSHQ Northbound Daily Quota Balance of Shanghai-Hong Kong Stock Connect” and “CSCSZQ Northbound Daily Quota Balance of Shenzhen-Hong Kong Stock Connect”

V1.21 9 Mar 2018 Revised Edition with the following updates

Effective Date Changes

30 April 2018 OMD-C Reference Data Enrichment : More product attributes are added to Security Definition (11)

Section 3.6.2 – Redefine Securities Definition (11) message with the following changes: a) Replace reserved fillers with new reference data :

- Product Type; - Upper Strike Price; - Warrant Type; - Call Price; - Entitlement; and - Number of Warrants per Entitlement

b) Revise description of existing attributes to reflect the enlarged coverage after the enrichment - Conversion Ratio - Style

c) Replace obsolete data fields with fillers - Test Security Flag - Underlying Security Weight

d) Remove reference to basket warrants

Include more indices in the Index Feed

Appendix A – Add Index Code for the following new index/indices: a) CES Stock Connect Hong Kong Premier 50 Index

Other housekeeping changes:

Section 2.4 – Revise the example of race conditions

Section 3.1.1 – Present Null Values in table format

Section 3.1.2 – Present Currency Codes in table format

Section 3.1.3 – Remove Section 3.1.3 Decimal Value, related information have been included in Developer Guide

Section 3.6.1, 3.6.2, 3.10.2, 3.11.1 – Change all references to “market” to “market segment”

Section 3.7.1 – Replace obsolete Trading Session ID with filler

Section 3.9.1 – Update reference to Public trade type

V1.22 12 Sep 2018 Revised Edition with the following updates

Effective Date Changes

Immediate Clarifications

Section 3.1.2 – Revise description for Currency Value

Appendix A – Update the note for CSI and CES index data

27 Oct 2018 Include more indices in the Index Feed

Appendix A – Add Index Code for the following new indices: a) Hang Seng Index (Gross Total Return Index) b) Hang Seng Finance Sub-Index (Gross Total Return Index) c) Hang Seng Utilities Sub-Index (Gross Total Return Index) d) Hang Seng Properties Sub-Index (Gross Total Return Index) e) Hang Seng Index Commerce & Industry Sub-Index (Gross Total

Return Index) f) Hang Seng China Enterprises Index (Gross Total Return Index)

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 6/61

g) Hang Seng Index (Net Total Return Index) h) Hang Seng Finance Sub-Index (Net Total Return Index) i) Hang Seng Utilities Sub-Index (Net Total Return Index) j) Hang Seng Properties Sub-Index (Net Total Return Index) k) Hang Seng Index Commerce & Industry Sub-Index (Net Total

Return Index) l) Hang Seng China Enterprises Index (Net Total Return Index)

V1.23 7 Nov 2018 Revised Edition with the following updates

Effective Date Changes

1 Dec 2018 Change of indices in the Index Feed

Appendix A Add Index Code for the following new index: a) CES HK Biotechnology Index

Remove Index Code for the following index: b) CSI Cross-Straits 500 Index

V1.24 21 May 2019 Revised Edition with the following updates

Effective Date Changes

Immediate Clarification

Section 3.10.1 – Update description for Statistics (60) message

24 June 2019 Include more indices in the Index Feed

Appendix A – Add Index Code for the following new indices: a) CES China Semiconductor Index b) HKEX CNH Gold Futures – Excess Return Index c) HKEX CNH Gold Futures – Total Return Index d) HKEX CNH Gold Futures – Spot Price Index e) HKEX USD Gold Futures – Excess Return Index f) HKEX USD Gold Futures – Total Return Index g) HKEX USD Gold Futures – Spot Price Index

Change of System Operation Window

Section 2.2.3, 2.2.4 – Adjust OMD-C MMDH shutdown time and the index messages transmission time.

V1.25 19 Jun 2019 Revised Edition with the following updates

Effective Date Changes

Immediate Introduction of Inline Warrant

Section 1.4 – Remove the instrument list from this section

Section 3.7.2 – Additional Product Type – 15 Warrant – Inline Warrant

V1.26 6 Sep 2019 Revised Edition with the following updates

Effective Date Changes

Q4 2019 (Upon OMD-C MMDH Technical Refresh)

Change on Password Policy

Section 2.2.1 – Update detail requirement of Password Policy

Section 3.4.2 – Update description on Password length

Section 3.4.3 – Remove value 100 from SessionStatus field

V1.27 31 Oct 2019 Revised Edition with the following updates

Effective Date Changes

10 Feb 2020 Introduction of New Spread Table Code Section 3.6.2 – Add Spread Table Code “04”

OMD-C MMDH Interface Specifications Document History

© Copyright 2019 HKEX 7/61

V1.28 26 Nov 2019 Revised Edition with the following updates

Effective Date Changes

Immediate Removal of indices in the Index Feed

Appendix A - Remove the following indices: a) 0200900 - Hang Seng Mainland Healthcare Index b) 0201100 - Hang Seng IT Hardware Index c) 0201200 - Hang Seng Software & Services Index

V1.29 4 Dec 2019 Revised Edition with the following updates

Effective Date Changes

Late February 2020 tentatively

Introduction of New Spread Table Code Section 3.7.2 – Add Spread Table Code “05”

OMD-C MMDH Interface Specifications Contents

© Copyright 2019 HKEX 8/61

CONTENTS

DOCUMENT HISTORY ................................................................................................................................................. 2

CONTENTS .................................................................................................................................................................. 8

1. INTRODUCTION .............................................................................................................................................. 10

1.1 PURPOSE ...................................................................................................................................................... 10

1.2 READING GUIDE.............................................................................................................................................. 10

1.3 SUMMARY TABLE ........................................................................................................................................... 10

1.4 SCOPE OF INFORMATION .................................................................................................................................. 11

2. SYSTEM OVERVIEW ........................................................................................................................................ 12

2.1 SCOPE .......................................................................................................................................................... 12 2.1.1 TCP Protocol.............................................................................................................................................. 12 2.1.2 Connection Options .................................................................................................................................. 12 2.1.3 Recovery Mechanisms .............................................................................................................................. 12 2.1.4 Server Disconnection ................................................................................................................................ 13

2.2 SESSION MANAGEMENT .................................................................................................................................. 13 2.2.1 Password Policy ........................................................................................................................................ 13 2.2.2 Start of Day ............................................................................................................................................... 13 2.2.3 Normal Transmission ................................................................................................................................ 13 2.2.4 End of Day ................................................................................................................................................. 14 2.2.5 Error Recovery .......................................................................................................................................... 14

2.3 TRADING SESSIONS ......................................................................................................................................... 14

2.4 RACE CONDITIONS .......................................................................................................................................... 14

3. MESSAGE FORMATS ....................................................................................................................................... 15

3.1 DATA TYPES .................................................................................................................................................. 15 3.1.1 Null Values ................................................................................................................................................ 15 3.1.2 Currency Values ........................................................................................................................................ 15

3.2 MESSAGE HEADER .......................................................................................................................................... 16

3.3 CONTROL MESSAGES ....................................................................................................................................... 17 3.3.1 Heartbeat.................................................................................................................................................. 17

3.4 LOGON ......................................................................................................................................................... 17 3.4.1 Send Key (1105) ........................................................................................................................................ 18 3.4.2 Logon (1101) ............................................................................................................................................. 19 3.4.3 Logon Response (1102) ............................................................................................................................. 20 3.4.4 Logout (1103) ........................................................................................................................................... 21

3.5 REFRESH ....................................................................................................................................................... 21 3.5.1 Refresh Request (1201) ............................................................................................................................. 21 3.5.2 Refresh Response (1202) .......................................................................................................................... 22 3.5.3 Refresh Complete (203) ............................................................................................................................ 22

3.6 REFERENCE DATA ............................................................................................................................................ 23 3.6.1 Market Definition (10) .............................................................................................................................. 23 3.6.2 Security Definition (11) ............................................................................................................................. 23 3.6.3 Liquidity Provider (13) ............................................................................................................................... 26

OMD-C MMDH Interface Specifications Contents

© Copyright 2019 HKEX 9/61

3.6.4 Currency Rate (14) .................................................................................................................................... 27

3.7 STATUS DATA ................................................................................................................................................ 28 3.7.1 Trading Session Status (20) ....................................................................................................................... 28 3.7.2 Security Status (21) ................................................................................................................................... 29

3.8 ORDER BOOK DATA ........................................................................................................................................ 29 3.8.1 Add Odd Lot Order (33)............................................................................................................................. 30 3.8.2 Delete Odd Lot Order (34) ......................................................................................................................... 30 3.8.3 Aggregate Order Book Update (53) .......................................................................................................... 31 3.8.4 Broker Queue (54) ..................................................................................................................................... 32 3.8.5 Order Imbalance (56) ................................................................................................................................ 33

3.9 TRADE AND PRICE DATA .................................................................................................................................. 34 3.9.1 Trade Ticker (52) ....................................................................................................................................... 34 3.9.2 Closing Price (62) ...................................................................................................................................... 35 3.9.3 Nominal Price (40) .................................................................................................................................... 35 3.9.4 Indicative Equilibrium Price (41) ............................................................................................................... 36 3.9.5 Reference Price (43) .................................................................................................................................. 36 3.9.6 VCM Trigger (23) ...................................................................................................................................... 37

3.10 VALUE ADDED DATA ....................................................................................................................................... 38 3.10.1 Statistics (60) ............................................................................................................................................ 38 3.10.2 Market Turnover (61) ............................................................................................................................... 38 3.10.3 Yield (44) ................................................................................................................................................... 39

3.11 NEWS ........................................................................................................................................................... 40 3.11.1 News (22) .................................................................................................................................................. 40

3.12 INDEX DATA AND MARKET INFORMATION ........................................................................................................... 41 3.12.1 Index Definition (70) ................................................................................................................................. 41 3.12.2 Index Data (71) ......................................................................................................................................... 42

3.13 STOCK CONNECT DATA .................................................................................................................................... 43 3.13.1 Stock Connect Daily Quota Balance (80) .................................................................................................. 43 3.13.2 Stock Connect Market Turnover (81) ........................................................................................................ 44

4. RECOVERY ...................................................................................................................................................... 45

4.1 RESTART ....................................................................................................................................................... 45

4.2 REFRESH SERVICE ........................................................................................................................................... 45

5. MESSAGE SCENARIOS .................................................................................................................................... 47

5.1 LOGON (START OF DAY) ................................................................................................................................... 47

5.2 RESTART (DATA IN RANGE) .............................................................................................................................. 47

5.3 REFRESH (DATA OUT OF RANGE) ...................................................................................................................... 48

5.4 PASSWORD CLOSE TO EXPIRY ........................................................................................................................... 49

5.5 CHANGE PASSWORD ....................................................................................................................................... 50

5.6 TWO LOGONS FROM SAME CLIENT..................................................................................................................... 50

5.7 ACCOUNT LOCKED (INTRADAY) .......................................................................................................................... 51

6. AGGREGATE ORDER BOOK MANAGEMENT .................................................................................................... 52

APPENDIX A - LIST OF INDICES AND MARKET INFORMATION UNDER OMD INDEX ................................................... 60

OMD-C MMDH Interface Specifications Introduction

© Copyright 2019 HKEX 10/61

1. INTRODUCTION

1.1 PURPOSE

This document specifies the Binary interface of the HKEX Orion Market Data Platform (“OMD”) for the MMDH (Mainland Market Data Hub).

This document is the Transmission Specification(s) of the relevant Datafeed(s) under your Market Data Vendor License Agreement or the Market Data End-User License Agreement (“License Agreement”). Please refer to Section 1.2 and the summary table at Section 1.3 and Section 1.4 for the information applicable to the Datafeed(s) under your License Agreement.

HKEX endeavors to ensure the accuracy and reliability of the information provided in this interface specification, but takes no responsibility for any errors or omissions or for any losses arising from decisions, action, or inaction based on this information. The Licensee shall not use such interface specifications for any purpose other than as expressly permitted under the Licence Agreement. No part of this document may be copied, distributed, transmitted, transcribed, stored in a retrieval system, translated into any human or computer language, or disclosed to third parties without written permission from HKEX-IS.

1.2 READING GUIDE

The chapters following this introduction are: Chapter 2: System Overview Chapter 3: Message Formats Chapter 4: Recovery Chapter 5: Message Scenarios Chapter 6: Aggregated Order Book Management Appendix A: List of Indices under OMD Index All chapters and appendices except Chapter 3 and Appendix A are applicable to all Datafeeds unless otherwise specified. In Chapter 3, there are indications* in individual sections/sub-sections for their applicability to individual Datafeeds, and Appendix A is applicable to OMD Index only. The information is also summarised in Section 1.3 Summary Table. * Example

Section OMD Securities Standard (SS)

OMD Index (Index)

3.3.1 ● ●

1.3 SUMMARY TABLE

Section Message Formats OMD Securities Standard (SS)

OMD Index (Index)

3.1 Data Types ● ●

3.2 Message Header ● ●

3.3 Control Messages ● ● 3.4 Logon ● ●

3.5 Refresh ● ●

3.6 Reference Data ●

3.7 Status Data ●

OMD-C MMDH Interface Specifications Introduction

© Copyright 2019 HKEX 11/61

3.8.1 Add Odd Lot Order (33)

3.8.2 Delete Odd Lot Order (34)

3.8.3 Aggregate Order Book Update (53) ●

3.8.4 Broker Queue (54) ●

3.8.5 Order Imbalance (56)

3.9.1 Trade Ticker (52) ●

3.9.2 Closing Price (62) ●

3.9.3 Nominal Price (40) ●

3.9.4 Indicative Equilibrium Price (41) ●

3.9.5 Reference Price (43) ●

3.9.6 VCM Trigger (23) ●

3.10.1 Statistics (60) ●

3.10.2 Market Turnover (61) ●

3.10.3 Yield (44) ●

3.11.1 News (22) ●

3.12 Index Data ● 3.13 Stock Connect Data

● The information supplied in the corresponding sub-section applies to the Datafeed(s)

Complimentary service to the Datafeed(s). Complimentary service

Odd Lot order information and Stock Connect Market Information will be provided in streaming mode as complementary services to clients subscribing to SS. Please refer to 3.8.1 and 3.8.2 for details on the odd lot order message; and refer to 3.13 for details on Stock Connect Data messages.

1.4 SCOPE OF INFORMATION

HKEX Orion Market Data Platform – Securities Market & Index Datafeed Products (“OMD-C”) MMDH provides real time trading information of all instruments listed and traded on the securities market, indices and market information to the Licensees.

OMD-C MMDH Interface Specifications System Overview

© Copyright 2019 HKEX 12/61

2. SYSTEM OVERVIEW

2.1 SCOPE

Mainland Market Data Hub ("MMDH") is a remote hub of the HKEX Orion Market Data Platform ("OMD") in Mainland China providing market data to local clients.

Data is represented in an efficient binary message format for all instruments listed on the Securities Market. It has been designed for high throughput and low latency.

2.1.1 TCP Protocol

In contrast to the OMD central system in Hong Kong which disseminates market real-time data to clients via multicast, MMDH provides real-time market data to clients in Mainland China via TCP.

Figure 1 - MMDH Connections

2.1.2 Connection Options

Client may choose one of the following connection options at MMDH:

Standard Configuration (with one live feed):

Under the standard configuration, each client is required to have a set of 3 leased lines, two connecting to the Primary Site and one connecting to the Secondary Site, to receive MMDH market data. An optional 4th connection can allow clients to connect two lines to the MMDH Secondary Site if desired. It should be noted that whilst 3 connections should be possible only one connection will ever be live at any one time. Multiple logons to MMDH are not permitted.

Non-Standard Configuration (with two live feeds):

Each client is required to have a set of 4 leased lines, two connecting to the Primary Site and two connecting to the Secondary Site, to receive MMDH market data. Clients can adopt to receive data transmission concurrently from both links to OMD Primary production system by using two distinct usernames to logon MMDH. OMD will operate the two links separately as if they were two primary links connected to two independent systems. Though clients can receive data concurrently from the two logons, multiple logons with same username is not allowed. Client who will supply OMD feeds to indirectly connected real-time vendors, subject to the Exchange’s prior approval, is required to adopt the non-standard configuration with two live feeds.

A configuration document for client’s network setup will be provided when the client has established the leased lines to the MMDH sites.

2.1.3 Recovery Mechanisms

The system provides two mechanisms for clients to recover possible data loss from disconnections, namely, Restart and Refresh. Please refer to section 4 (Recovery) for an explanation or sections 5.2 and 5.3 for examples.

OMD-C MMDH Interface Specifications System Overview

© Copyright 2019 HKEX 13/61

2.1.4 Server Disconnection

In rare situations the MMDH Server may initiate a disconnection which may require clients to re-load all static data for all instruments. Clients should re-establish connection and logon again and then use the ‘SessionStatus’ field within the Logon Response message to determine appropriate recovery action. See section 3.4.3 (Logon Response) and section 4 (Recovery) for details.

2.2 SESSION MANAGEMENT

OMD-C MMDH does not operate on non-trading days of the Hong Kong Securities Market except those days when there are real-time index data calculated and disseminated by the index compiler. HKEX may perform system testing on Saturdays, Sundays or days when OMD-C MMDH is not in operation. Clients should treat data transmitted via OMD-C MMDH on those days as non production data and disregard them.

2.2.1 Password Policy

Client account shall be locked for at least 30 minutes upon 6 consecutive unsuccessful logon attempts

Client must change their password on the first logon attempt after the password is reset by HKEX due to whatever reason (e.g. client forgets the old password)

Passwords will expire after 90 calendar days

Passwords should meet all the following items:

Item Requirement

Length of password At least 16 characters

Complexity of password

Must contain a combination of: 1. Upper case letter 2. Lower case letter 3. Number 4. Special character as listed below:

Character Name

! Exclamation @ At sign # Number sign (hash) $ Dollar sign ^ Caret & Ampersand * Asterisk ( Left parenthesis ) Right parenthesis

Enforce password history Not the same as any of the last 5 passwords

2.2.2 Start of Day

OMD-C MMDH is normally ready for a new business day at 6:00am. However, the Exchange has the right to adjust the system ready time in the future according to the different trading situations.

After a client has established a TCP connection the first message received will be a SendKey (1105) message with sequence number 1, and then following successful logon the client should expect to receive a Logon Response (1102) message with sequence number 2. On receipt of this message, the client must clear all cached data for all instruments. The static data for all markets, securities, liquidity providers and currency rates is published each day shortly after successful logon.

If a client connects to OMD-C MMDH after the start of business day and the amount of market data missed by the client is too large to be recovered through the Restart recovery mechanism, OMD-C MMDH will return a logon response to indicate they need to refresh.

2.2.3 Normal Transmission

Normal message transmission is expected between the time whenever there is any update either in OMD Securities Standard (SS) or OMD Index (Index)*. Heartbeats are sent regularly when there is no activity – the length of time between

OMD-C MMDH Interface Specifications System Overview

© Copyright 2019 HKEX 14/61

heartbeats being specified in the Logon Response (1102) message. Under normal transmission the “SeqNum” field values in the message headers received (except heartbeats) by clients are consecutive and increasing. Reliable transmission is guaranteed by the TCP/IP protocol and gaps in transmission will not happen as long as the TCP connection is intact.

* Order and trade message transmission in SS is expected between when the market opens for trading and when the market is closed whereas message transmission in INDEX is expected between 8:00am to 3:00am, next day across midnight.

2.2.4 End of Day

OMD-C MMDH will normally be shut down shortly after 3:00am, next day across midnight thereupon will stop sending messages (including heartbeats). This shutdown time, however, is not rigid and the Exchange has the right to adjust this time according to the different trading situations.

2.2.5 Error Recovery

2.2.5.1 System Component Failure

If a system component fails and requires a failover or restart, there will be a short interruption in dissemination of data.

When MMDH resumes operation, clients can reconnect based on the last sequence number received and in this way receive all messages during the outage period if those messages are still held in MMDH for Restart recovery or, otherwise, the latest market snapshot from Refresh.

Standard Configuration clients are recommended to attempt connecting in a round robin fashion via the 2 leased lines to MMDH Primary Site. Normally the clients can connect via any of the 2 leased lines to MMDH in the Primary Site unless MMDH failovers to the Secondary Site, by then the clients can connect via the leased line(s) to the MMDH in the Secondary Site.

Similarly, Non-Standard Configuration clients are recommended to connect separately via the 2 leased lines to MMDH Primary Site for the 2 live connections. When MMDH fails over to the Secondary Site, the clients can connect separately via the 2 leased lines to MMDH Secondary Site for the 2 live connections.

2.2.5.2 Disaster Recovery

Disaster Recovery services do exist and clients will be provided with a set of IP addresses for both the MMDH Primary and Secondary sites. The same username and password will apply to both.

Since sequence numbers between the Primary site and the Secondary site are not guaranteed to be the same a Refresh may be required. Clients should specify the 'InternalSeqNum' as 0 during their first Logon to the Secondary site and the MMDH system at Secondary site will respond with Restart recovery required or indicate the need for a Refresh. Any subsequent disconnects should continue to use the last seen number the same as for the MMDH Primary.

2.3 TRADING SESSIONS

Normally, trading is conducted in auction trading session(s) and continuous trading session(s) every trading day. However, there are situations where there is only half day trading with fewer trading session(s) (Christmas eve, New Year eve and Chinese New Year eve), or a trading session is suspended due to a typhoon etc. MMDH is not affected by the number of trading sessions and will continue to provide real time data as long as the Exchange’s trading system is available.

2.4 RACE CONDITIONS

The information supplied in this section does not apply to OMD Index. Since order, trade and reference data are transmitted to MMDH via separate paths this may lead to a race condition. As an example the Trading Session Status (20) messages and market activity are decoupled; e.g. for a short time after a TradSesStatus of "Halted" is reported real-time data for that same market may continue to arrive.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 15/61

3. MESSAGE FORMATS

3.1 DATA TYPES

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.1 ● ●

The following table lists all the data types used by OMD.

Format Description

String ASCII characters which are left aligned and padded with spaces, unless otherwise specified

Uint8 8 bit unsigned integer

Uint16 Little-Endian encoded 16 bit unsigned integer

Uint32 Little-Endian encoded 32 bit unsigned integer

Uint64 Little-Endian encoded 64 bit unsigned integer

Int16 Little-Endian encoded 16 bit signed integer

Int32 Little-Endian encoded 32 bit signed integer

Int64 Little-Endian encoded 64 bit signed integer

Binary Unicode encoding used for Chinese characters which are left aligned and padded with binary null

3.1.1 Null Values

From time to time certain fields cannot be populated and specific values are used to represent null. This is currently used within Int64 fields of the Index Data (71) message.

Data Type Null Representation Example of Usage

Int64 0x8000000000000000 (Hex 2’s complement) or -9223372036854775808 (Decimal)

HighValue, LowValue of Index Data (71)

3.1.2 Currency Values

Please refer to the Third Schedule of Rules of the Exchange in HKEX website for possible ISO-4217 Currency Codes used in OMD-C. Apart from the Currency Codes listed in the aforesaid Schedule, OMD-C will also use the Currency Code listed below:

Currency Code Currency

CNH Chinese Renminbi (Offshore)

HKEX may add or delete currency code(s), whenever applicable, in the future.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 16/61

3.2 MESSAGE HEADER

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.2 ● ●

TCP Header and Data sample layout:

TCP Header Message Header +

Message 1 Message Header +

Message 2 …

Message Header + Message N

All messages will begin with the standard TCP Header followed by a variable number of Messages. This is true both for messages disseminated by OMD and client messages sent to the MMDH.

Message Header

Offset Field Format Len Description

0 MsgLength Uint16 2 Size of the message (including the header)

2 Filler String 2

4 SeqNum Uint32 4 Sequence number of the message and is consecutive

8 InternalSeqNum Uint32 4 Internal MMDH sequence number

12 SendTime Uint64 8 The number of nanoseconds since midnight Coordinated Universal Time (UTC) of January 1, 1970, precision is provided to the nearest millisecond

Header length 20

SeqNum starts from 1 for each logon and increases with sequential consecutive sequence numbers.

InternalSeqNum should only be used in the event of intraday disconnection and in this case the last received InternalSeqNum should be provided in the Logon (1101) message – see section 3.4.2 Logon (1101) for details. This field is populated on every message except during refresh – refresh messages do not have an internal sequence number – see section 5.3 for details. InternalSeqNum is incremental but not necessarily consecutive. Client may find gaps in the InternalSeqNum values of consecutive messages.

When sending messages to the MMDH (e.g. Logon (1101) or Refresh Request (1201)), the same message header must also be used by clients. In this event the ‘SeqNum’ and ‘InternalSeqNum’ fields within the Message Header need not be populated. Note however the ‘InternalSeqNum’ field within the Logon message would need to be provided.

The format of each message will vary according to message type. However, regardless of the message type, each message will start with a two-byte message size (MsgSize) followed by a two-byte message type (MsgType). These are described in the following table.

Table 1: MsgSize and MsgType Fields

Field Format Len Description

MsgSize Uint16 2 Message length (including this field)

MsgType Uint16 2

Type of message. The valid values for MsgType are below: Logon (1101) Logon Response (1102)- MMDH Response

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 17/61

Field Format Len Description

Logout (1103) SendKey (1105) Refresh Request (1201) Refresh Response (1202) Refresh Complete (203) Market Definition (10) Security Definition (11) Liquidity Provider (13) Currency Rate (14) Trading Session Status (20) Security Status (21) Add Odd Lot Oder (33) Delete Odd Lot Order (34) Aggregate Order Book Update (53) Broker Queue (54) Order Imbalance (56) Trade Ticker (52) Closing Price (62) Nominal Price (40) Indicative Equilibrium Price (41) Reference Price (43) VCM Trigger (23) Statistics (60) Market Turnover (61) Yield (44) News (22) Index Definition (70) Index Data (71) Stock Connect Daily Quota Balance (80) Stock Connect Market Turnover (81)

3.3 CONTROL MESSAGES

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.3 ● ●

3.3.1 Heartbeat

Heartbeats consist of a message header with length set to the message header length. They do not increment the sequence number. SeqNum is set to the sequence number of the previous message. The Heartbeat message will be identical for all the services.

When not sending data the Server will repeatedly send heartbeat messages every few seconds and the period is communicated by the HeartBtInterval sent in the Logon Response (1102) message.

Also, clients should repeatedly send a heartbeat message to the Server at all times to maintain the TCP connection. The heartbeat should be periodic – as defined by the HeartBtInterval field received in the Logon Response (1102) message. If the server does not receive the expected heartbeat messages from the client two times in a row, then the server will logout the client and the client will receive the Logout (1103) message. See section 3.4.4 Logout (1103).

3.4 LOGON

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 18/61

Section OMD Securities Standard (SS)

OMD Index (Index)

3.4 ● ●

Refer to Logon 5.1 within Message Scenarios for details on the restart messages.

3.4.1 Send Key (1105)

Prior to commencing Logon, MMDH clients must first exchange cryptographic keys with the OMD system and this is achieved using the Diffie-Hellman key exchange algorithm. The keys are then used to encrypt the password or new password fields during logon.

Prime, Generator, Public Key and Initialization Vector parameters are required by the client to complete the key exchange, which are sent by the MMDH server to the client once a TCP session is established. These parameters are sent in the ‘SendKey’ message.

The following diagram shows the first three messages transferred during all Logon scenarios:

Figure 1 - SendKey and Logon

Step 1

Client opens connection to Server

On connection the Client is sent a SendKey (1105) message containing the Diffie-Hellman parameters and a

concatenated public key and random Initialisation Vector “IV”

Step 2

Client calculates parameters and sends a Logon (1101) message

Client sets Diffie-Hellman parameters (prime, generator, subgroup order) from the values contained in the

SendKey (1105) message

Client generates a random public and private key pair

Client creates a shared secret based on the OMD public key and the client private key

Client uses SHA-256 to hash the shared secret to enable the creation of an AES Key

Client encrypts the password using the generated AES Key in CFB mode, with the IV passed by the Server to

the client (contained in the OMDPublicKey field)

Client populates a Logon (1101) message containing the encrypted password and the client public key

Note: the same method is used to encrypt the ‘newpassword’ field if password change is required

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 19/61

Step 3

Client sends Logon to Server

Server creates a shared secret based on the Client public key and the OMD private key

Uses SHA-256 to hash the shared secret to enable the creation of an AES Key

Decrypts the password using the generated AES Key in CFB mode, with the server stored IV

Continues normal logon procedure: e.g. authenticates the password against the password hash stored in the

database, and checks for dual logon, etc.

Populates a LogonResponse message

Step 4

Client receives LogonResponse from Server

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 1105 Send Key

4 Prime Data 128 A large Prime number in hexadecimal format

132 Generator Data 128 Generator – A primitive root modulo the value of Prime in hexadecimal format

260 PrimeOrderSubgroup Data 128

388 OMDPublicKey Data 144

First 128 bytes: the Public Key being shared Last 16 bytes: the Initialization Vector

Total Length 532

3.4.2 Logon (1101)

The Logon (1101) message for clients enables both the mechanism for client authentication and password management.

Password length is between 16 and 20 characters.

Normal operation is as follows:-

Client sends Logon (1101) message containing username and encrypted password to the MMDH Publisher, which responds with the SessionStatus of 0 (Session active). The InternalSeqNum field will be used to assist with intra-day recovery but at start of day, should be set to 0. In the case of intra-day recovery the user can set the ‘InternalSeqNum’ field to the last received internal sequence number (this is one of the fields in the message header).

If the fields EncryptedNewPasswordLen and EncryptedNewPassword are populated, the logon attempt is seen as a password change attempt. During normal logon these fields should be empty.

See sections 5.1, 5.2, 5.3, 5.4 and 5.5 for diagrams showing the scenarios where this message is used.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 20/61

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message. 1101 Logon

4 Username String 12 Username to log on, padded with binary null characters

16 InternalSeqNum Uint32 4 Set to the last received internal sequence number; Or 0 at the start of the day

20 ClientPublicKey Data 128 Generated according to the algorithm shown above

148 EncryptedPasswordLen Uint8 1 Length of the EncryptedPassword in bytes

Integer

149 EncryptedPassword Data 20 AES Encrypted password

169 EncryptedNewPasswordLen Uint8 1 Length of the EncryptedNewPassword in bytes

Integer

170 EncryptedNewPassword Data 20 AES Encrypted new password

Total Length 190

3.4.3 Logon Response (1102)

If the password is reset by HKEX Operations then the user should specify this password as well as their new password details during their next logon attempt – see Change Password Message scenario in Section 5.5 for details. If the user does not specify their new password details then the user will receive a Logon Response (1102) message “SessionStatus” set to “Password expired”.

Further attempts to use an expired password will be rejected with reason of “password expired”. If this happens, the Subscriber has to reattempt logon until a correct new password has been specified and accepted.

Notes:

The client is expected to adhere to the HeartBtInterval populated within the logon response provided by MMDH to avoid disconnection – see section 3.3.1 for details.

A TCP disconnection will follow SessionStatus return values of 5, 6, 104 or 105. In these cases clients should reconnect and wait for a new SendKey(1105) message before re-attempting Logon.

A user account may be locked by HKEX Operations or when users exceed the maximum number of logins permitted per day – indicated by a SessionStatus return value of 6.

See sections 5.1, 5.2, 5.3, 5.4 and 5.5 for diagrams showing the scenarios where this message is used.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 1102 Logon Response

4 HeartBtInterval Uint16 2 Heartbeat Interval

6 SessionStatus Uint8 1 Status of the session 0 Session active

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 21/61

Offset Field Format Len Description Values

1 Session password

changed 2 Session password due to

expire 3 New session password

does not comply with policy 5 Invalid username or

password 6 Account locked

8 Password expired

101 Session Active - refresh

required 104 Already Connected

105 Client Public Key

Generation Issue

7 PasswordExpiryDays Uint8 1 Number of days left before password expires

Numerical

Total Length 8

3.4.4 Logout (1103)

The logout message is issued from the MMDH to inform clients when they have been logged out. The server will follow with a TCP disconnect. See sections 5.6 and 5.7 for diagrams showing the scenarios where this message is used.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 1103 Logout

4 SessionStatus Uint8 1 Session Status

6 Account locked

102 Logon from second

connection 103 Heartbeat timeout

5 Filler String 3

Total Length 8

3.5 REFRESH

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.5 ● ●

Refer to Refresh and restart scenarios within Message Scenarios, Section 5, for details on the Refresh and Restart messages.

3.5.1 Refresh Request (1201)

Used to request a Refresh of all market state from MMDH – for content detail refer to section 4.2 Refresh Service.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 22/61

See section 5.3 for a diagram showing the scenario where this message is used.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 1201 Refresh Request

Total Length 4

3.5.2 Refresh Response (1202)

Used to acknowledge an application refresh request.

See section 5.3 for a diagram showing the scenario where this message is used.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 1202 Refresh Response

4 RefreshStatus Uint8 1 Status of the refresh response 0 Request fully

processed

5 Filler String 3

Total Length 8

3.5.3 Refresh Complete (203)

This message is published at the end of a refresh cycle to demonstrate that the system has re-sent all messages.

Once all refresh data is sent, the client is up to date and will continue to receive normal data flow as messages arrive.

See section 5.3 for a diagram showing the scenario where this message is used.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 203 Refresh Complete

4 LastInternalSeqNum Uint32 4

The internal sequence number with this refresh (matches the Message Header)

Numerical

Total Length 8

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 23/61

3.6 REFERENCE DATA

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.6 ●

3.6.1 Market Definition (10)

The Market Definition message is generated at the start of the business day for each market segment.

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message. 10 Market Definition

4 MarketCode String 4 Market segment identifier

MAIN

GEM

NASD

ETS

8 MarketName String 25 Market segment name Alphanumerical

33 CurrencyCode String 3 Base currency code of the market segment.

See Currency Values in section 3.1.2 for full details.

36 NumberOfSecurities

Uint32 4 Number of securities within the market segment

Total Length ................................................................ 40

3.6.2 Security Definition (11)

This Security Definition (11) message contains all the reference data for a security.

Security Definition (11) messages may be received intraday – for example the ‘FreeText’ field may be updated during the day.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 11 Security Definition

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 MarketCode String 4 Market segment identifier MAIN

GEM

NASD

ETS

12 ISINCode String 12 ISIN code of the security

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 24/61

Offset Field Format Len Description Values

24 InstrumentType String 4 Instrument type of the security BOND Bonds

EQTY Equities

TRST Trusts

WRNT Warrants & Structured

products

28 ProductType Uint8 1 Product type of the security Equity

1 Equity – Ordinary Shares

2 Equity – Preference Shares

6 Equity – Rights

7 Equity – Depository Receipt

(HDR) – Ordinary Shares 12 Equity – Depository Receipt

(HDR) – Preference Shares

Warrant

3 Warrant – Derivative Warrant

(DW) 11 Warrant – Callable Bull/Bear

Contract (CBBC) 13 Warrant – Equity Warrant

14 Warrant – Equity Linked

Instrument (ELI) 15 Warrant – Inline Warrant

Bond

4 Bond – Debt Security

Trust

5 Trust – Exchange Traded Fund

(ETF) 8 Trust – Real Estate Investment

Trust (REIT) 9 Trust – Other Unit Trusts

10Trust – Leveraged and Inverse

Product (LIP) 99 Others – None of the above

29 Filler String 1

30 SpreadTableCode String 2 Spread table code of the security

01 Part A*

03 Part B*

04 For Inline Warrant (same as

Part A up to and include HK$ 1.00 as per SEHK)

05 Part D*

* Spread table as per Second Schedule of Rules of the Exchange

32 SecurityShortName String 40 Security short name

72 CurrencyCode String 3 Security currency code of the market

See Currency Values in section 3.1.2 for full details.

75 SecurityNameGCCS Binary 60 Security name in Traditional Chinese using Unicode

Unicode UTF-16LE encoded

135 SecurityNameGB Binary 60 Security name in Simplified Chinese using Unicode

Unicode UTF-16LE encoded

195 LotSize Uint32 4 Board lot size for the security

199 Filler String 4

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 25/61

Offset Field Format Len Description Values

203 PreviousClosingPrice Int32 4 Previous closing price of the security

3 implied decimal places

207 VCMFlag String 1 Indicates whether Volatility Control Mechanism (VCM) is applicable to the security

Y VCM applicable

N VCM not applicable

208 ShortSellFlag String 1 Indicator for short-sell authorization

Y Short-sell allowed

N Short-sell not allowed

209 CASFlag String 1 Indicates whether Closing Auction Session (CAS) is applicable to the security

Y CAS applicable

N CAS not applicable

210 CCASSFlag String 1 Indicates whether or not the security is a CCASS security

Y CCASS security

N Non CCASS security

211 DummySecurityFlag String 1 Dummy Security Flag Y Dummy security

N Normal security

212 Filler String 1

213 StampDutyFlag String 1 Indicator for stamp duty requirement

Y Stamp duty required

N Stamp duty not required

214 Filler String 1

215 ListingDate Uint32 4 Date of security listing The representation is YYYYMMDD Value is 19000101 for unknown

listing date

219 DelistingDate Uint32 4 Date of security delisting The representation is YYYYMMDD. Value is 0 if no date exists.

223 FreeText String 38 Free text associated to the security

Fixed length array of free text. When there is no free text, spaces will be present instead.

261 Filler String 82

Bonds Specific Data

343 EFNFlag String 1 EFN Indicator Y EFN

N Non-EFN

344 AccruedInterest Uint32 4 Accrued interest of the security 3 implied decimal places

348 CouponRate Uint32 4 Coupon rate of a bond security 3 implied decimal places

352 Filler String 42

Warrants, Basket Warrants and Structured Product specific data

394 ConversionRatio Uint32 4 Conversion ratio for Structured Product

3 implied decimal places

398 StrikePrice1 Int32 4 Strike price of the security if it has only one strike price, or Lower strike price of the security if it has lower and upper strike prices (i.e. upper strike price not = 0)

3 implied decimal places

402 StrikePrice2 Int32 4 Upper strike price of the security if it has lower and upper strike prices

3 implied decimal places Value is 0 if the securities has only

one strike price

406 MaturityDate Uint32 4 Date of maturity of a warrant or structured security

The representation is YYYYMMDD

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 26/61

Offset Field Format Len Description Values

410 CallPutFlag String 1 Indicator of whether the warrant or structured product is a call or put option

For Derivative Warrants / Inline Warrants: C Call

P Put

O Others

For ELI & CBBC: C Bull

P Bear / Rang

411 Style String 1 Style of the warrant A American style

E European style

<blank> Other

412 Filler String 2

414 WarrantType String 1 Warrant type of the warrant N Normal instrument

X Exotic instrument

“0” Not available

415 CallPrice Int32 4 Call price for CBBC See DecimalsInCallPrice for the number of decimal places defined 0 Not available

419 DecimalsInCallPrice Uint8 1 Number of decimal places in Call Price

Not applicable if CallPrice = 0

420 Entitlement Int32 4 Entitlement of the warrant See DecimalsInEntitlement for the number of decimal places defined 0 Not available

424 DecimalsInEntitlement Uint8 1 Number of decimal places in Entitlement

Not applicable if Entitlement = 0

425 NoWarrantsPerEntitlement Uint32 4 Number of warrants per entitlement

Not applicable if Entitlement = 0

429 Filler String 33

462 NoUnderlyingSecurities Uint16 2 Number of underlying security codes within this message

0 for structured product of which the

underlying is not a security defined in Security Definition (11) message

1 for structured product of which the underlying is defined in Security Definition (11) message

464 UnderlyingSecurityCode Uint32 4 5-digit code identifying the

underlying security

468 Filler Uint32 4

Total Length ................................................ 464 + 8nU

(nU = value of NoUnderlyingSecurities)

Note:

(1) PreviousClosingPrice may be set to 0, for example on the first day of listing (no existing previous closing price)

(2) Fields in Bonds Specific Data & Warrants and Structured Product Specific Data should be ignored if they are not applicable to the InstrumentType

3.6.3 Liquidity Provider (13)

The Liquidity Provider (13) message is generated at the start of the business day for securities that have at least one liquidity provider.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 27/61

Message Fields

Offset Field Format Len

Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 13 Liquidity Provider

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 NoLiquidityProviders Uint16 2 Number of liquidity providers within this message

1 to 50

10 LPBrokerNumber Uint16 2 Broker number of the liquidity provider

Total Length ................................................ 10 + 2nT

(nT = value of NoLiquidityProviders)

3.6.4 Currency Rate (14)

The Currency Rate message provides the foreign exchange conversion rates between various foreign currencies and the Hong Kong dollar.

The Currency Factor and Currency Rate fields should be interpreted as below:

For example if 1 Euro is valued 10.22 HKD

Currency Factor will be 0 (1 EUR)

Currency Rate will be 102200 (4 decimals implied)

For example if 1000 Japanese Yen is worth 90.678 HKD

Currency Factor will be 3 (1000 JPY)

Currency Rate will be 906780 (4 decimals implied)

Message Fields

Offset Field Format Len

Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 14 Currency Rate

4 CurrencyCode String 3 Currency code. See Currency Values in section 3.1.2 for full details.

7 Filler 1

8 CurrencyFactor Uint16 2 Currency factor conversion.

A non-zero value n means all price

fields for this security should be interpreted as a value equal to the price multiplied by 10n.

10 Filler 2

12 CurrencyRate Uint32 4 Currency rate Rate, expressed in HKD for one foreign currency unit. 4 decimals implied.

Total Length .......................................................... 16

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 28/61

3.7 STATUS DATA

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.7 ●

3.7.1 Trading Session Status (20)

The Trading Session Status provides information on the status of a market segment. It is sent whenever there is change of trading session.

This message may not be synchronized with order and trade data.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 20 Trading Session Status

4 MarketCode String 4 Market segment identifier

MAIN

GEM

NASD

ETS

8 Filler Uint8 1

9 TradingSessionSubID Uint8 1 Trading session sub-identifier

0 Day Close (DC)

1 Pre-trading [Pre-Opening

Session (POS)] Order Input (OI) 2 Opening or Opening Auction

[POS] Matching (MA) 3 Continuous trading (CT)

4 Closing or Closing Auction

[Closing Auction Session (CAS)] Matching (MA) 5 Post-trading [CAS] Order

Input (OI) 7 Quiescent (i.e. Blocking) (BL)

100 Not Yet Open (NO)

101 No Cancel/Modification

[POS] (NC) 102 Exchange Intervention (EI)

103 Close (CL)

104 Order Cancel (OC)

105 Reference Price Fixing [CAS]

(RP) 106 No Cancellation [CAS] (NW)

107 Random Close [CAS] (RC)

10 TradingSesStatus Uint8 1 Status of the current trading session

0 Unknown (for NO)

1 Halted (for BL, EI)

2 Open (for POS OI,POS NC,

POS MA, CT, OC) 3 Closed (for CL)

5 Pre-Close (for [CAS] RP,

[CAS] NW, [CAS] RC, [CAS] MA, [CAS] OI)1 100 Day Closed (for DC)

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 29/61

Offset Field Format Len Description Values

11 TradingSesControlFlag String 1 Indicates how control of trading session and sub-session transitions are performed

0 Automatic (Default)

1 Manual (this invalidates the

normal schedule for the day)

12 Filler String 4

16 StartDateTime Uint64 8 Start time of the trading status

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, precision is provided to the nearest second. Set to 0 if no time is available.

24 EndDateTime Uint64 8 End time of the trading status

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, precision is provided to the nearest second. Set to 0 if no time is available.

Total Length ............................................................. 32

3.7.2 Security Status (21)

The Security Status message is generated

At the start of the business day if the security is not available for trading..

Whenever a security state changes.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 21 Security Status

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 SuspensionIndicator Uint8 1 Indicate whether the security is currently halted/ suspended for trading

2 Trading Halt or Suspend

3 Resume

9 Filler String 3

Total Length ................................................................ 12

Note: ‘Resume’ in Suspension Indicator means the security is now available for trading,

3.8 ORDER BOOK DATA

This section includes definition of the following messages:

Add / Delete Odd Lot Order – for odd lot orders

Aggregate Order Book Update – for board lot orders

Broker Queue – for board lot orders

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 30/61

3.8.1 Add Odd Lot Order (33)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.8.1

(via complimentary odd lot order feed)

Complimentary service to the Datafeed(s)

The Add Odd Lot Order message is generated when a new odd lot order is inserted into the order book.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 33 Add Odd Lot Order

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 OrderId Uint64 8 Unique identifier for each order performed within the trading day

Values may not be consecutive

16 Price Int32 4 Price 3 implied decimal places

20 Quantity Uint32 4 Number of shares

24 BrokerID Uint16 2 Integer identifier uniquely identifying the Broker

Integer

26 Side Uint16 2 Side of the order 0 Bid

1 Offer

Total Length ................................................................ 28

3.8.2 Delete Odd Lot Order (34)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.8.2

(via complimentary odd lot order feed)

Complimentary service to the Datafeed(s)

The Delete Odd Lot Order message is generated when an existing odd lot order identified by the OrderId is deleted.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 34 Delete Odd Lot Order

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 31/61

Offset Field Format Len Description Values

8 OrderId Uint64 8 Unique identifier for each order performed within the trading day

Values may not be consecutive

16 BrokerID Uint16 2 Integer identifier uniquely identifying the Broker

Integer

18 Side Uint16 2 Side of the order 0 Bid

1 Offer

Total Length .................................................................. 20

3.8.3 Aggregate Order Book Update (53)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.8.3 ●

Refer to Section 6 - Aggregate Order Book Management for details on the Aggregate Order Book Update message. The Aggregate Order Book Update message only applies to Board Lots.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 53 Aggregate Order Book

Update

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 Filler String 3

11 NoEntries Uint8 1 Number of book entries within the message

12 AggregateQuantity Uint64 8 Aggregated number of shares.

20 Price Int32 4 Price 3 implied decimal places

24 NumberOfOrders Uint32 4 Number of orders

28 Side Uint16 2 Side of the order 0 Bid

1 Offer

30 PriceLevel Uint8 1 Price level

31 UpdateAction Uint8 1 Type of market data update action

0 New

1 Change

2 Delete

74 Orderbook Clear

32 Filler String 4

Total Length ............................................................. 12 +

24nO

(nO = value of NoEntries)

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 32/61

3.8.4 Broker Queue (54)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.8.4 ●

The Broker Queue message contains the priority list of the (max) top 40 broker IDs for a given side, and is generated whenever any of the entries in the list are modified. Entries are ordered according to distance away from the best price with best price brokers being at the front of the queue. The queue will also include spread level entries between each price level, which are marked when the Type field is set to ‘S’. When the Type field is set to ‘S’, there are two possibilities;

The Item is non-zero – indicating the number of spread levels away from the best price

The Item is zero – indicating that there are no brokers with orders at the spread level indicated by the previous entry of Type set to ‘S’

Example: if the active offers are as below, and assuming a spread level is 0.01:

Ask Price Broker ID

20.28 2137

20.28 4138

20.29 2141

20.29 5123

20.31 3145

Then the resulting Ask side Broker Queue will be represented as below:

Entry 1 2 3 4 5 6 7 8 9

Item 2137 4138 1 2141 5123 2 0 3 3145

Type B B S B B S S S B

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 54 Broker Queue

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 ItemCount Uint8 1

This field contains the number of items in the message – repeating items are shown indented below

0 to 40

9 Side Uint16 2 Side of the order 1 Buy

2 Sell

11 BQMoreFlag String 1 Flag indicating if there are more broker numbers in the queue

Y More broker numbers exist in

the queue N No more exist

12 Item Uint16 2 This field contains either the broker number or the number

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 33/61

Offset Field Format Len Description Values

of spreads away from the best price

14 Type String 1 Indicates the type of information contained in the item

B Broker number

S Number of Spread

15 Filler String 1

Total Length ................................................................ 12 + 4nI

(nI = value of ItemCount)

3.8.5 Order Imbalance (56)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.8.5 ●

The Order Imbalance message provides order imbalance information at the Indicative Equilibrium Price (IEP) during the Closing Auction Session (CAS).

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 56 Order Imbalance

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 OrderImbalanceDirection String 1

Indicates the imbalance direction when the matchable buy quantity and sell quantity at IEP are not equal

N Buy = Sell

B Buy Surplus

S Sell Surplus

<space> Not applicable, i.e. when IEP is not available

9 Filler String 1

10 OrderImbalanceQuantity Uint64 8

The absolute difference between the matchable buy quantity and the sell quantity at IEP Value should be ignored if Order Imbalance Direction is <space>

18 Filler String 2

Total Length ............................................................. 20

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 34/61

3.9 TRADE AND PRICE DATA

3.9.1 Trade Ticker (52)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.1 ●

The Trade Ticker is an aggregation of several trades into one message, combining quantities of subsequent trades made on a given instrument at a given fixed price.

When a trade is cancelled, a Trade Ticker message will be generated with the TickerID set to the ticker which contains the cancelled trade, and with the AggregateQuantity set to remaining quantity outstanding.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 52 Trade ticker

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 TickerID Uint32 4

Unique identifier per security for each trade ticker generated within the trading system. The ID is unique per security for each trading day

Starting from 1, incrementing by 1

for each trade ticker

12 Price Int32 4 Price 3 implied decimal places

16 AggregateQuantity Uint64 8 Aggregated number of shares Remaining quantity if TrdCancelFlag = Y

24 TradeTime Uint64 8 Time of trade

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970 TradeTime is up to seconds Not applicable when TrdCancelFlag = Y

32 TrdType Int16 2 Public trade type

0 Automatch normal (Public

Trade Type <space>) 4 Late Trade (Off-exchange

previous day) (Public Trade Type “P”)

22 Non-direct Off-Exchange Trade

(Public Trade Type “M”) 100 Automatch internalized (Public

Trade Type “Y”) 101 Direct off-exchange Trade

(Public Trade Type “X”) 102 Odd-Lot Trade (Public Trade

Type “D”) 103 Auction Trade (Public Trade

Type “U”)

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 35/61

Offset Field Format Len Description Values

Not applicable when TrdCancelFlag = Y

34 TrdCancelFlag String 1 Indicates that a trade covered in the original Trade Ticker has been cancelled

Y Cancelled

N Not cancelled

35 Filler String 1

Total Length ................................................................ 36

3.9.2 Closing Price (62)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.2 ●

The Closing Price message is generated near the end of the business day for each security. If the closing price is not available, the field ‘ClosingPrice’ is set to 0.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 62 Closing Price

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 ClosingPrice Int32 4 Current Day Closing Price 3 implied decimal places

12 Filler String 4

Total Length ..................................................................... 16

3.9.3 Nominal Price (40)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.3 ●

The Nominal Price message may be generated when an order is added, deleted or modified in a book or when trade or trade cancel is performed. Before the arrival of the first Nominal Price message, the nominal price should be the same as the previous closing price provided in the Security Definition (11) message.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 40 Nominal Price

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 36/61

Offset Field Format Len Description Values

8 NominalPrice Int32 4 Nominal price of a security 3 implied decimal places

Total Length ............................................................. 12

Note: Nominal Price may be 0 in specific cases (e.g. no reference price)

3.9.4 Indicative Equilibrium Price (41)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.4 ●

The Indicative Equilibrium Price (IEP) message is generated whenever there is change of the Indicative Equilibrium Price (IEP) or Indicative Equilibrium Volume (IEV) during the Pre-Opening Session (POS) or Closing Auction Session (CAS). The IEP will become 0 when IEP does not exist.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 41 Indicative Equilibrium Price

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 Price Int32 4 IEP 3 implied decimal places Value is 0 if IEP is not available

12 AggregateQuantity Uint64 8 IEV

Total Length ................................................................ 20

3.9.5 Reference Price (43)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.5 ●

This message provides the reference price, lower and upper price limits for order input during an applicable auction session and will be sent again when there is any change of the reference price, lower and upper price limits during the session. Also the same information may be resent during the auction session. For Closing Auction Session (CAS), a Reference Price message is generated at the start of the session for all the securities tradable on the day, regardless of whether it is a CAS applicable security or not.

For Pre-Opening Session (POS), no Reference Price messages are sent.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 37/61

Offset Field Format Len Description Values

2 MsgType Uint16 2 Type of message 43 Reference Price

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 ReferencePrice Int32 4 Reference price of the security for order input

3 implied decimal places Value is 0 if the reference price is not available

12 LowerPrice Int32 4 Lower price of the allowed price band for order input

3 implied decimal places 0 means N/A

16 UpperPrice Int32 4 Upper price of the allowed price band for order input

3 implied decimal places 0 means N/A

Total Length ................................................................ 20

Note: Reference Price may be 0 in special cases (e.g. no nominal price).

3.9.6 VCM Trigger (23)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.9.6 ●

The VCM Trigger message is generated whenever a cooling off period is triggered by Volatility Control Mechanism (VCM).

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 23 VCM Trigger

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 CoolingOffStartTime Uint64 8 Time when the cooling off period starts

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, precision is provided to the nearest second.

16 CoolingOffEndTime Uint64 8 Time when the cooling off period ends

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, precision is provided to the nearest second.

24 VCMReferencePrice Int32 4 Reference Price for the cooling off period

3 implied decimal places

28 VCMLowerPrice Int32 4 Lower price in the price band allowed during the cooling off period

3 implied decimal places

32 VCMUpperPrice Int32 4 Upper price in the price band allowed during the cooling off period

3 implied decimal places

Total Length ............................................................. 36

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 38/61

3.10 VALUE ADDED DATA

3.10.1 Statistics (60)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.10.1 ●

The Statistics message provides statistics including high/low prices and turnover. It is generated, excluding overseas trades, once after:

all corresponding trades matched in Continuous Trading Session (CTS) or in an auction session

manual trade

odd lot trade

trade cancel

The ShortSellSharesTraded and ShortSellTurnover fields (the shortsell fields) are only updated twice each day at most for securities with shortselling activities - at the end of the morning session if the shortsell fields are non-zero and at the end of the afternoon session if the value of any of the shortsell fields are different from that disseminated at the end of the morning session.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 60 Statistics

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

8 SharesTraded Uint64 8 Number of shares traded for a security

16 Turnover Int64 8 Current turnover 3 implied decimal places

24 HighPrice Int32 4 Highest trade price currently performed for a security

3 implied decimal places

28 LowPrice Int32 4 Lowest trade price currently performed for a security

3 implied decimal places

32 LastPrice Int32 4 Last trade price for a security 3 implied decimal places

36 Filler String 4

40 ShortSellSharesTraded Uint32 4 Number of short-sell shares traded for a security

44 ShortSellTurnover Int64 8 Current short-sell turnover for a security

3 implied decimal places

Total Length ................................................................ 52

3.10.2 Market Turnover (61)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 39/61

Section OMD Securities Standard (SS)

OMD Index (Index)

3.10.2 ●

The Market Turnover message contains the total turnover (excluding the turnover of overseas trades) for all securities on a given market segment for a given trading currency. It also provides the total turnover (excluding the turnover of overseas trades) for all securities regardless of trading currency on a given market segment in HKD equivalent. Under normal circumstances, the updates are disseminated around every 2 seconds during the trading hours.

When the CurrencyCode is blank, the turnover represents the total turnover traded on the given market segment for all trading currencies, expressed in HKD.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 61 Market Turnover

4 MarketCode String 4 Market segment identifier

MAIN

GEM

NASD

ETS

8 CurrencyCode String 3 Currency code of all securities of which the market turnover is derived

See Currency Values in section 3.1.2 for full details. Blank for total turnover for the Market Segment (i.e. MarketCode) in HKD equivalent.

11 Filler String 1

12 Turnover Int64 8

Total Traded Turnover of the stocks traded on the market segment in the respective currency

3 implied decimal places

Total Length ..................................................................... 20

3.10.3 Yield (44)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.10.3 ●

The Yield message is generated for bond securities when their yield percentage changes.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 44 Yield

4 SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 40/61

Offset Field Format Len Description Values

8 Yield Int32 4 Current yield of the bond security based on its coupon rate and nominal price

3 implied decimal places 0 means Not available

Total Length ................................................................ 12

3.11 NEWS

3.11.1 News (22)

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.11.1 ●

The News message is generated whenever a news update occurs. The message indicates which markets and/or securities the news is applied to. If NoMarketCode and NoSecurityCodes are both set to zero, the news applies to all markets.

The news may be fragmented across multiple consecutive messages. The LastFragment field will be set to ‘Y’ in the message that contains the last fragment. The "Headline" will only be carried in the first message and blanked from the second message onwards.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 22 News

4 NewsType String 3 Type of Exchange news EXN Exchange news

EXC Chinese Exchange news

7 NewsID String 3 Unique number for the news page within each NewsType

10 Headline String / Binary

320 News headline

If NewsType is EXN the Headline is

ASCII encoded If NewsType is EXC the Headline is

Unicode UTF-16LE encoded

330 CancelFlag String 1

Indicator of whether previously released exchange news (identified by NewsType and NewsID) has been cancelled

Y Cancelled

N Not cancelled

331 LastFragment String 1 Indicates whether this message is the last in a sequence of messages

Y Complete

N Not complete

332 Filler String 4

336 ReleaseTime Uint64 8 Release time of the news

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970 ReleaseTime precision is currently provided to the nearest second.

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 41/61

Offset Field Format Len Description Values

344 Filler String 2

346 NoMarketCodes Uint16 2 Number of market codes within this message

0 to 4

348 MarketCode String 4 Market segment identifier

MAIN

GEM

NASD

ETS

348 + 4nM Filler String 2

350 + 4nM NoSecurityCodes Uint16 2 Number of security codes within this message

0 to 200

352+ 4nM SecurityCode Uint32 4 Uniquely identifies a security available for trading

5 digit security codes with possible values 1 – 99999

352 + 4nM +

4nS Filler String 2

354 + 4nM +

4nS NoNewsLines Uint16 2 Number of news lines

Maximum of 10 lines per “news page” is currently supported

356 + 4nM +

4nS NewsLine

String / Binary

160 News line

If NewsType is EXN the NewsLine

is ASCII encoded If NewsType is EXC the NewsLine

is Unicode UTF-16LE encoded

Total Length ....................................... 356 + 4nM + 4nS+

160np

(nM = value of NoMarketCodes)

(nS = value of NoSecurityCodes)

(np = value of NoNewsLines)

3.12 INDEX DATA AND MARKET INFORMATION

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.12 ●

The indices and market information supplied under the OMD Index are described in more detail in Appendix A, as it may be amended from time to time.

3.12.1 Index Definition (70)

The Index Definition message contains the static referential data for the given index and market information and is generated at the start of the business day and may be re-disseminated during the trading hours.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 70 Index and Market Information

Definition

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 42/61

Offset Field Format Len Description Values

4 IndexCode String 11 Upstream source’s index code or market information identifier

See Index Code in Appendix A for full details.

15 IndexSource String 1 Index source

C CSI or other source of market

information H HSI

S S&P

T TR

16 CurrencyCode String 3 Currency code of Index Turnover

See Currency Values in section 3.1.2 for full details.

19 Filler String 1

Total Length ..................................................................... 20

3.12.2 Index Data (71)

The Index Data message contains all the real-time data for a given index and real-time market information. Fields within this message may be populated with null values to identify when an update is not provided. See section 3. 1.1 (Null Values) for more information about null values.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 71 Index Data and Market

Information

4 IndexCode String 11 Upstream source’s index code or market information identifier

See Index Code in Appendix A for full details

15 IndexStatus String 1 Index status

C Closing value

I Indicative

O Opening index

P Last close value (prev. ses.)

R Preliminary close

S Stop loss index

T Real-time index value

IndexStatus can be blank if not defined by third party index compilers

16 IndexTime Int64 8 Publisher timestamp

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970 IndexTime precision is currently provided to the nearest second.

24 IndexValue Int64 8 Current value of the index 4 implied decimal places

32 NetChgPrevDay Int64 8 Net change of IndexValue from the previous close, as provided in index source

4 implied decimal places

40 HighValue Int64 8 Highest value for an index 4 implied decimal places

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 43/61

Offset Field Format Len Description Values

48 LowValue Int64 8 Lowest value for an index 4 implied decimal places

56 EASValue Int64 8 Estimated Average Settlement Value

2 implied decimal places

64 IndexTurnover Int64 8 Current turnover of underlying constituents

4 implied decimal places

72 OpeningValue Int64 8 First value for an index 4 implied decimal places

80 ClosingValue Int64 8 Last value for an index 4 implied decimal places

88 PreviousSesClose Int64 8

Previous session closing value (previous day’s closing value for CSI and S&P, previous session’s closing value for HSI and TR)

4 implied decimal places

96 IndexVolume Int64 8 Index volume of underlying constituents. Only applicable for CSI

104 NetChgPrevDayPct Int32 4

Percentage change of IndexValue from the previous close, as provided in index source

4 implied decimal places

108 Exception String 1 Exception indicator

# Index with HSIL defined

exceptional rule applied ' ' Normal index (empty string)

109 Filler String 3

Total Length ..................................................................... 112

3.13 STOCK CONNECT DATA

The information supplied in this section and its sub-sections applies to the Datafeed(s) marked with [●]

Section OMD Securities Standard (SS)

OMD Index (Index)

3.13

Complimentary service to the Datafeed(s)

3.13.1 Stock Connect Daily Quota Balance (80)

The Stock Connect Daily Quota Balance message provides updates on the Northbound Daily Quota Balance (DQB) for Shanghai-Hong Kong Stock Connect and Shenzhen-Hong Kong Stock Connect separately. Under normal circumstances, the updates are disseminated around every 5 seconds during the trading hours.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 80 Stock Connect Daily Quota

Balance

4 StockConnectMarket String 2 Market connected under Stock Connect Program

SH Shanghai Stock Exchange

SZ Shenzhen Stock Exchange

OMD-C MMDH Interface Specifications Message Formats

© Copyright 2019 HKEX 44/61

Offset Field Format Len Description Values

6 TradingDirection String 2 Trading Direction NB Northbound trading

8 DailyQuotaBalance Int64 8

Northbound Daily Quota Balance (DQB) value for specified Stock Connect Program

DQB in Renminbi (RMB) 0 when the respective DQB is used

up

16 DailyQuotaBalanceTime Uint64 8 Time of DailyQuotaBalance

The number of nanoseconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970 DailyQuotaBalanceTime precision is currently provided to the nearest second.

Total Length ..................................................................... 24

3.13.2 Stock Connect Market Turnover (81)

The Stock Connect Market Turnover message provides aggregate turnover under Shanghai-Hong Kong Stock Connect and Shenzhen-Hong Kong Stock Connect (“the Stock Connect programs”). The aggregate turnover is provided for the Northbound trading and the Southbound trading separately under each of the Stock Connect programs. Under normal circumstances, the updates are disseminated around every one minute during the trading hours.

Message Fields

Offset Field Format Len Description Values

0 MsgSize Uint16 2 Size of the message

2 MsgType Uint16 2 Type of message 81 Stock Connect Market

Turnover

4 StockConnectMarket String 2 Market connected under Stock Connect Program

SH Shanghai Stock Exchange

SZ Shenzhen Stock Exchange

6 TradingDirection String 2 Trading Direction NB Northbound trading

SB Southbound trading

8 BuyTurnover Int64 8

Total turnover of Buy trades from the Northbound or Southbound trading (as specified in TradingDirection) under the Stock Connect Program rounded down to integer

Turnover in RMB for Northbound trading and HKD for Southbound trading

16 SellTurnover Int64 8

Total turnover of Sell trades from the Northbound or Southbound trading (as specified in TradingDirection) under the Stock Connect Program rounded down to integer

Turnover in RMB for Northbound trading and HKD for Southbound trading

24 Buy+SellTurnover Int64 8 Sum of the values of BuyTurnover and SellTurnover rounded down to integer

Turnover in RMB for Northbound trading and HKD for Southbound trading

Total Length ................................................................ 32

OMD-C MMDH Interface Specifications Recovery

© Copyright 2019 HKEX 45/61

4. RECOVERY

The system provides 2 mechanisms for clients to recover possible data loss from disconnections, namely, Restart and Refresh. On reconnection, clients should always present the InternalSeqNum received in the last message from the server in the InternalSeqNum in the Logon message. The decision to perform a Restart or Refresh, however, is determined by the server and users should use the SessionStatus field within the Logon Response message to determine whether Restart or Refresh is required.

4.1 RESTART

For short outages where the lost messages are still held in MMDH for Restart recovery, when clients reconnect as above and following successful logon, the system will resume data dissemination from the next message following the message associated with InternalSeqNum supplied in Logon.

However, if the requested message indicated by InternalSeqNum is no longer available in MMDH, MMDH will provide a logon response message with the Session Status value set to ‘101’ (Session Active - Refresh required) and the user should use the Refresh service which is described below.

4.2 REFRESH SERVICE

The Refresh service is designed to allow clients to recover from a large scale data loss. This can happen after a late start or during a major outage. Clients should clear all market data received from MMDH for the day from their systems before processing Refresh messages. The refresh service is request based and in order to initiate a refresh the client must send a Refresh Request (1201) message after successful logon – see section 3.5.1 for details. The messages provided and processing of the refresh messages are described below.

Snapshot Processing

See the sequence diagram shown in section 5.3 (Refresh (Data Out Of Range)) to understand the messaging scenario. A Refresh Complete message is sent at the end of a snapshot and following this message the real time data will resume automatically.

Latest Market Snapshot

Data available in the Latest Market Snapshot is described in the table below. During refresh the static data for all markets, securities, liquidity providers and currency rates will be sent first.

Message Snapshot description

Market Definition Latest market static message for each market.

Security Definition Latest security static message for each security.

Liquidity Provider Latest liquidity provider message for each security.

Trading Session Status Latest trading session status message for each market.

Security Status Security Status message for halted securities and securities resumed trading with status changed to 'resumed' on the current trading day.

Add Odd Lot Order Snapshot for all non-empty books (for odd lot orders).

Aggregate Order Book Update

Snapshot for all non-empty books (for board lot orders). Occasionally Aggregated Order Book Update messages will be sent for emptied order books after cancellation or matching of all outstanding orders. In such cases the value of the NoEntries will be “0”.

Broker Queue Snapshot for all non-empty books (for board lot orders). Occasionally Broker Queue messages will be sent for emptied broker queues after cancellation or matching of all outstanding orders. In such cases the value of the ItemCount will be “0”.

Order Imbalance Latest Order Imbalance message for each CAS applicable security.

Closing Price Closing Price message if available for each security.

Indicative Equilibrium Price

Latest Indicative Equilibrium Price message for each security.

Nominal Price Latest nominal price message for each security.

Reference Price Latest Reference Price for each security.

OMD-C MMDH Interface Specifications Recovery

© Copyright 2019 HKEX 46/61

Message Snapshot description

VCM Trigger Latest VCM Trigger message for each VCM applicable security with cooling off period trigged by VCM.

Statistics Latest Statistics message for each security.

Market Turnover Latest Market Turnover message per market / currency pair.

Currency Rate Latest Currency Rate message for each currency.

News All News messages.

Index Definition Latest Index Definition message for each index.

Index Data Latest Index Data message for each index.

Yield Latest Yield message generated for bond securities when their yield percentage last changed.

Stock Connect Daily Quota Balance

Latest Stock Connect Daily Quota Balance for each Stock Connect Program.

Stock Connect Market Turnover

Latest Stock Connect Market Turnover for each Stock Connect Program and trading direction.

OMD-C MMDH Interface Specifications Message scenarios

© Copyright 2019 HKEX 47/61

5. MESSAGE SCENARIOS

There are a number of scenarios described in this section. For each scenario, a pictorial representation of the flow of the messages is provided.

5.1 LOGON (START OF DAY)

When logon is attempted there are a number of responses possible from the MMDH Publisher. The scenario below shows 5 possible responses. In each case the ‘SessionStatus’ field is used to indicate the result.

See sections 3.4.2 Logon (1101) and 3.4.3 Logon Response (1102) for message fields that are used for this scenario.

Figure 2 - Logon

5.2 RESTART (DATA IN RANGE)

The server maintains a short history of recent messages which are available for Restart. If the InternalSeqNum provided during Logon is available within this history then the server will simply provide all messages between InternalSeqNum up to the current latest real-time message. Normal data flow continues thereafter.

Typically a restart is possible at the beginning of the day or very soon after a service interruption (where the client is reconnecting).

See sections 3.4.2 Logon (1101) and 3.4.3 Logon Response (1102) for message fields that are used for this scenario

OMD-C MMDH Interface Specifications Message scenarios

© Copyright 2019 HKEX 48/61

Figure 3 - Restart

5.3 REFRESH (DATA OUT OF RANGE)

The Logon (1101) message includes the ‘InternalSeqNum’ field. If the sequence number specified is too old then clients will be prompted to request a Refresh (the server only maintains a limited number of recent messages). The need for Refresh is indicated by a Logon Response with Session Status value of 101. On receiving this message clients should clear all cached data for all instruments and then send a Refresh Request (1202) message to the server. The server will respond with the Latest Market Snapshot.

The Latest Market Snapshot contains all messages defined in section 4.2 (Refresh Service). Once all Latest Market Snapshot data is sent the client is up to date and will continue to receive normal data flow as it arrives. Note that messages within the Latest Market Snapshot do not carry any internal sequence number. The new latest internal sequence number will be provided in the Refresh Complete message.

See sections 3.4.2 Logon (1101), 3.4.3 Logon Response (1102), 3.5.1 Refresh Request (1201), 3.5.2 Refresh Response (1202) and 3.5.3 Refresh Complete (203) for message fields that are used for this scenario.

OMD-C MMDH Interface Specifications Message scenarios

© Copyright 2019 HKEX 49/61

Figure 4 – Restart (Intraday)

5.4 PASSWORD CLOSE TO EXPIRY

When a valid Logon (1101) message is sent but there are only a few days left before expiry of the password, the system will allow the user to logon normally but the Logon Response message will have SessionStatus set to 2 (“Session password due to expire”). Data will continue to flow as normal but the user should change their password as soon as possible – see section 5.5 (Change Password) for details.

See sections 3.4.2 Logon (1101) and 3.4.3 Logon Response (1102) for message fields that are used for this scenario.

Figure 5 - Expiry Warning

OMD-C MMDH Interface Specifications Message scenarios

© Copyright 2019 HKEX 50/61

5.5 CHANGE PASSWORD

A change of password may be attempted by specifying two fields within the Logon (1101) message, these fields are:

EncryptedNewPasswordLen

EncryptedNewPassword

Successful password changes will be indicated with a ‘SessionStatus’ value of 1 in the Logon Response. Other values indicate policy violations. If successful the Client should then send a new Logon (1101) message with the new password value to resume normal data flow.

Another alternative is that the HKEX Operations team have manually changed the password. This temporary password is valid only for the next logon attempt, and the user must change their password at the next logon. If the user doesn’t specify new password credentials correctly they will receive a ‘Password expired’ response, or possibly an ‘Against Policy’ response if the new password doesn’t meet HKEX policy criteria (see section 2.2.1 for policy details). The message flow for changing a password that has been reset by HKEX Operations is identical to the above but the user must use the temporary password during the first Logon (1101) message and at the same time also send values within the EncryptedNewPassword and EncryptedNewPasswordLen fields.

See sections 3.4.2 Logon (1101) and 3.4.3 Logon Response (1102) for message fields that are used for this scenario.

Figure 6 - Change Password

5.6 TWO LOGONS FROM SAME CLIENT

Multiple logons are not permitted. In this scenario a 2nd logon is attempted, which is rejected and additionally the first client is also disconnected. Notice that the TCP/IP session is broken and must be re-established by the client – the server always forces disconnect after sending the Logout(1103) message.

See sections 3.4.2 Logon (1101), 3.4.3 Logon Response (1102) and 3.4.4 Logout (1103) for message fields that are used for this scenario.

OMD-C MMDH Interface Specifications Message scenarios

© Copyright 2019 HKEX 51/61

Figure 7 - Dual Logons

5.7 ACCOUNT LOCKED (INTRADAY)

If an account is locked by the MMDH Operations Team, the Client will receive a Logout message.

See section 3.4.4 Logout (1103) for message fields that are used for this scenario.

Figure 8 - Account Locked

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 52/61

6. AGGREGATE ORDER BOOK MANAGEMENT

Book Identification

For each security there exists an odd lot book and a board lot book in the trading system. A book is therefore uniquely identified by SecurityCode.

Partial Price Depth

Securities shall be traded in accordance with the scale of spreads set out in the Second Schedule of the Rules of the Exchange respective to the Spread Table Code specified in their Securities Definition message. The tick level provides information on how many spreads from the best price for an order price whereas a price level is assigned to each price existing in the OMD order book. An order price with tick level 1 means the order price is the best price, a tick level of 2 means the order price is one spread from the best price, etc. The Aggregate Order Book Update message sends out the price level but not the tick level.

The concept of tick and price levels is illustrated in the table below, assuming that the best bid price of a security is 9800 and the spread is 10 for this price range. In the table there are orders in 5 bid prices so the number of price levels is 5 (contiguous price levels from 1 to 5); these orders are distributed over 10 spreads (tick levels) so the tick levels are from 1 to 10. Taking orders with bid price 9710 as example, it is the 5th price in the book so the price level will be 5 and it is 9 spreads from the best bid price so the tick level will be 10.

Bid Side

Tick PriceLevel AggregateQuantity Price

1 1 700 9800

2 2 350 9790

3

4

5 3 150 9760

6

7

8

9 4 250 9720

10 5 100 9710

OMD provides a view of 10 tick depths of the aggregate order book for securities market and does not provide updates on price levels which are more than 9 spreads away from the best price. This view can be visualized as a number of rows in a table for each of the bid and ask sides. On each side there are a number of rows showing the aggregate quantity available at a number of price levels and tick levels.

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 700 9730 9760 500 1 1

2 2 350 9720 9770 300 2 2

3 3 150 9710 9780 100 3 3

4 4 250 9700 9790 150 4 4

5 5 100 9690 5

6 6 150 9680 6

7 7 50 9670 7

8 8 200 9660 8

9 9 100 9650 9

10 10

OMD only sends updates within the 10 tick levels in the aggregate order book except for Explicit Deletion (please refer Example 5 illustrated below for details)

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 53/61

Book Updates

Book update messages are generated by OMD as delta messages defined in section 3.8.3 (Aggregate Order Book Update (53)). Each message may contain any combination of new, changed or deleted entries for a book. The nature of an entry is defined by its UpdateAction.

New, to create/insert a new price level

Delete, to remove a price level

Change, to update aggregate quantity at a price level

Orderbook Clear, to inform users that all price levels should be cleared

Example 1 – Quantity Reduction and Explicit Addition

For example suppose the Ask order at price level 9770 is reduced in quantity and at the same time a new order is added at price level 9850, then the following message is sent;

Offset Field Name Value

0 MsgSize 60

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 2

12 AggregateQuantity 200

20 Price 9770

24 NumberOfOrders 1

28 Side 1 (Offer)

30 PriceLevel 2

31 UpdateAction 1

32 Filler NULL

36 AggregateQuantity 300

44 Price 9850

48 NumberOfOrders 1

52 Side 1 (Offer)

54 PriceLevel 5

55 UpdateAction 0

56 Filler NULL

The resulting book should now be as follows:

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 700 9730 9760 500 1 1

2 2 350 9720 9770 200 2 2

3 3 150 9710 9780 100 3 3

4 4 250 9700 9790 150 4 4

5 5 100 9690 5

6 6 150 9680 6

7 7 50 9670 7

8 8 200 9660 8

9 9 100 9650 9

10 9850 300 5 10

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 54/61

Example 2 – Implicit Level Adjustments

The client must adjust the price level of entries below deleted or inserted entries. Potential level adjustments must be carried out after each single entry in Aggregate Order Book message.

For example, if a bid order with price 9740 and quantity 50 is added to the order book above, it will cause the following message to be sent:

Offset Field Name Value

0 MsgSize 36

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 1

12 AggregateQuantity 50

20 Price 9740

24 NumberOfOrders 1

28 Side 0 (Bid)

30 PriceLevel 1

31 UpdateAction 0

32 Filler NULL

After processing this message, the client’s book should look as follows:

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 50 9740 9760 500 1 1

2 2 700 9730 9770 200 2 2

3 3 350 9720 9780 100 3 3

4 4 150 9710 9790 150 4 4

5 5 250 9700 5

6 6 100 9690 6

7 7 150 9680 7

8 8 50 9670 8

9 9 200 9660 9

10 10 100 9650 9850 300 5 10

Price levels of the other 9 Bid orders must all be incremented although there will not be Aggregate Order Book Update messages sent for the increment.

Example 3 – Implicit Deletions

If a new book entry causes the bottom entry of a book to be shifted out of the book (i.e. more than 9 spreads away from the best price), the client must delete the excess entry. If the book shrinks again, the server resends the entries that have temporarily fallen out.

For example, if a bid order with price 9750 and quantity 250 is added to the book above, and the bid quantity at price 9660 is reduced from 200 to 150, it will cause the following message to be sent:

Offset Field Name Value

0 MsgSize 60

2 MsgType 53

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 55/61

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 2

12 AggregateQuantity 250

20 Price 9750

24 NumberOfOrders 1

28 Side 0 (Bid)

30 PriceLevel 1

31 UpdateAction 0

32 Filler NULL

36 AggregateQuantity 150

44 Price 9660

48 NumberOfOrders 1

52 Side 0 (Bid)

54 PriceLevel 10

55 UpdateAction 1

56 Filler NULL

After processing this message, the client’s book should look as follows:

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 250 9750 9760 500 1 1

2 2 50 9740 9770 200 2 2

3 3 700 9730 9780 100 3 3

4 4 350 9720 9790 150 4 4

5 5 150 9710 5

6 6 250 9700 6

7 7 100 9690 7

8 8 150 9680 8

9 9 50 9670 9

10 10 150 9660 9850 300 5 10

Price 9750 and quantity 250 is added according to the message.

Price 9650 and quantity 100 must be deleted by the client.

Price 9660 quantity must be reduced to 150 – PriceLevel 10 is used in the incoming message to reflect the new price level of the price 9660 after the addition of the price 9750.

Example 4 – Explicit Additions

If a match causes an order to be removed so that there are now less than 10 levels visible then the server will also automatically send the additional level(s) that are now revealed.

For example, if the bid order with price 9750 and quantity 250 is now removed from the book above and this reveals an 11th level which needs to be disseminated then it will cause the following message to be sent:

Offset Field Name Value

0 MsgSize 60

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 56/61

11 NoEntries 2

12 AggregateQuantity 250

20 Price 9750

24 NumberOfOrders 1

28 Side 0 (Bid)

30 PriceLevel 1

31 UpdateAction 2

32 Filler NULL

36 AggregateQuantity 100

44 Price 9650

48 NumberOfOrders 1

52 Side 0 (Bid)

54 PriceLevel 10

55 UpdateAction 0

56 Filler NULL

The resulting order book should now be;

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 50 9740 9760 500 1 1

2 2 700 9730 9770 200 2 2

3 3 350 9720 9780 100 3 3

4 4 150 9710 9790 150 4 4

5 5 250 9700 5

6 6 100 9690 6

7 7 150 9680 7

8 8 50 9670 8

9 9 200 9660 9

10 10 100 9650 9850 300 5 10

Example 5 – Explicit Deletions

Suppose a new book entry causes the last tick entry (Tick 10 in the previous order book in Example 4) to be shifted out of the book, if the shifted out entry is within 10 price level, OMD will send an explicit deletion for the entry. If the shifted out entry is outside the 10 price level, OMD will not send further updates on that price and the client must delete the excess entry (please refer to Example 3 above for details) to ensure their order book will not keep out-dated information.

For example, if an ask order with price 9750 and quantity 300 is added to the order book above, it will cause the following message to be sent:

Offset Field Name Value

0 MsgSize 60

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 2

12 AggregateQuantity 300

20 Price 9750

24 NumberOfOrders 1

28 Side 1 (Offer)

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 57/61

30 PriceLevel 1

31 UpdateAction 0

32 Filler NULL

36 AggregateQuantity 300

44 Price 9850

48 NumberOfOrders 1

52 Side 1 (Offer)

54 PriceLevel 6

55 UpdateAction 2

56 Filler NULL

The resulting order book should now be;

Bid Side Ask Side

Tick PriceLevel AggregateQuantity Price Price AggregateQuantity PriceLevel Tick

1 1 50 9740 9750 300 1 1

2 2 700 9730 9760 500 2 2

3 3 350 9720 9770 200 3 3

4 4 150 9710 9780 100 4 4

5 5 250 9700 9790 150 5 5

6 6 100 9690 6

7 7 150 9680 7

8 8 50 9670 8

9 9 200 9660 9

10 10 100 9650 10

Explicit Deletions versus Implicit Deletions

Suppose initially bid orders are queued in 8 price levels in the aggregate order book and assume there is no order inputted at price 9770 & 9740. The aggregate order book will be as follows.

Bid Side

Tick PriceLevel AggregateQuantity Price

1 1 700 9800

2 2 350 9790

3 3 150 9780

4

5 4 250 9760

6 5 100 9750

7

8 6 400 9730

9 7 200 9720

10 8 300 9710

When new bid orders at 3 different prices (9860, 9850 & 9840) arrived, the resulting book will be changed as follows:

Bid Side

Tick PriceLevel AggregateQuantity Price

1 1 450 9860 new order, Explicit Addition

2 2 550 9850 new order, Explicit Addition

3 3 650 9840 new order, Explicit Addition

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 58/61

4

5

6

7 4 700 9800 previous best bid, now at PriceLevel 4 (Tick 7), Implicit Level Adjustment

8 5 350 9790 previous 2nd best bid, now at PriceLevel 5 (Tick 8), Implicit Level Adjustment

9 6 150 9780 previous 3rd best bid, now at PriceLevel 6 (Tick 9), Implcit Level Adjustment

10

11 7 250 9760 orders exceed 10 Tick but within 10 PriceLevel, Explicit Deletion

12 8 100 9750 orders exceed 10 Tick but within 10 PriceLevel, Explicit Deletion

13

14 9 400 9730 orders exceed 10 Tick but within 10 PriceLevel, Explicit Deletion

15 10 200 9720 orders exceed 10 Tick but within 10 PriceLevel, Explicit Deletion

16 11 300 9710 orders exceed 10 Tick & exceed 10 PriceLevel, Implicit Deletion

Orders in shaded area which were originally within the 10 tick levels offered in OMD now fall outside the 10 tick levels. OMD will send Explicit Delete for orders which fall outside 10 tick levels but are within 10 price levels (i.e. entries highlighted in blue). However OMD will not send Explicit Delete for orders which are outside 10 price levels (i.e. entries highlighted in pink) and the client must delete the excess entries (i.e. Implicit Delete by the client).

The following message will be sent:

Offset Field Name Value

0 MsgSize 180

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 7

12 AggregateQuantity 450

20 Price 9860

24 NumberOfOrders 1

28 Side 0 (Bid)

30 PriceLevel 1

31 UpdateAction 0

32 Filler NULL

36 AggregateQuantity 550

44 Price 9850

48 NumberOfOrders 1

52 Side 0 (Bid)

54 PriceLevel 2

55 UpdateAction 0

56 Filler NULL

60 AggregateQuantity 650

68 Price 9840

72 NumberOfOrders 1

76 Side 0 (Bid)

78 PriceLevel 3

79 UpdateAction 0

80 Filler NULL

84 AggregateQuantity 250

92 Price 9760

96 NumberOfOrders 1

100 Side 0 (Bid)

OMD-C MMDH Interface Specifications Aggregate order Book Management

© Copyright 2019 HKEX 59/61

102 PriceLevel 7

103 UpdateAction 2

104 Filler NULL

108 AggregateQuantity 100

116 Price 9750

120 NumberOfOrders 1

124 Side 0 (Bid)

126 PriceLevel 7

127 UpdateAction 2

128 Filler NULL

132 AggregateQuantity 400

140 Price 9730

144 NumberOfOrders 1

148 Side 0 (Bid)

150 PriceLevel 7

151 UpdateAction 2

152 Filler NULL

156 AggregateQuantity 200

164 Price 9720

168 NumberOfOrders 1

172 Side 0 (Bid)

174 PriceLevel 7

175 UpdateAction 2

176 Filler NULL

Example 6 – Orderbook Clear

In certain failure scenarios the system may send an ‘Orderbook Clear’ message at which point clients should clear both Bid and Ask side orderbooks for the specified security. An example message is shown below.

Following an ‘Orderbook Clear’ message any existing orders for the security will be resent as normal to rebuild the current image.

Offset Field Name Value

0 MsgSize 36

2 MsgType 53

4 SecurityCode 1234

8 Filler NULL

11 NoEntries 1

12 AggregateQuantity 0

20 Price 0

24 NumberOfOrders 0

28 Side 0

30 PriceLevel 0

31 UpdateAction 74

32 Filler NULL

OMD-C MMDH Interface Specifications Appendix A - List of Indices and Market Information Under OMD Index

© Copyright 2019 HKEX 60/61

APPENDIX A - LIST OF INDICES AND MARKET INFORMATION UNDER OMD INDEX

The information supplied in this appendix applies to OMD Index only.

The indices supplied under the OMD Index are described in the table below, as it may be amended from time to time by HKEX-IS pursuant

to clause 2.2 of the Licence Agreement. The mark [●] specifies if an index disseminated under the OMD Index is Third Party Content

under the Licence Agreement. Licensee shall refer to clause 10.6 of the Market Data Vendor Licence Agreement and notices issued by HKEX-IS from time to time for redistribution of Third Party Content.

The Index Source and Index Code in the table below include the source and code for market information.

Index Source

Index Code Name of the Index and market information disseminated under the OMD Index

Third Party Content under

the Licence Agreement

Third Party Index Ownership

C CES120 CES China 120 Index ● CES

C CESA80 CES China A80 Index ● CES

C CESHKM CES China HK Mainland Index ● CES

C CES280 CES China 280 Index ● CES

C CESG10 CES Gaming Top 10 Index ● CES

C CES300 CES Stock Connect 300 Index ● CES

C CES100 CES Stock Connect Hong Kong Select 100 Index ● CES

C CESHKB CES HK Biotechnology Index ● CES

C CESP50 CES Stock Connect Hong Kong Premier 50 Index ● CES

C CESCSC CES China Semiconductor Index ● CES

C CSI300 CSI 300 Index ● CSI

C 000942 CSI China Mainland Consumer Index ● CSI

C H11123 CSI HK Mainland Enterprises 50 Index ● CSI

C H11100 CSI Hong Kong 100 Index ● CSI

C H11140 CSI Hong Kong Dividend Index ● CSI

C H11144 CSI Hong Kong Listed Tradable Mainland Consumption Index ● CSI

C H11143 CSI Hong Kong Listed Tradable Mainland Real Estate Index ● CSI

C H11120 CSI Hong Kong Middle Cap Select Index ● CSI

C H11152 CSI Hong Kong Private-owned Mainland Enterprises Index ● CSI

C H11153 CSI Hong Kong State-owned Mainland Enterprises Index ● CSI

C H11110 CSI RAFI Hong Kong 50 Index ● CSI

C 000016 SSE 50 Index ● SSE

C 000021 SSE 180 Governance Index ● SSE

C 000010 SSE 180 Index ● SSE

C 000009 SSE 380 Index ● SSE

C 000066 SSE Commodity Equity Index ● SSE

C 000001 SSE Composite Index ● SSE

C 000015 SSE Dividend Index ● SSE

C 000043 SSE Mega-cap Index ● SSE

C 000044 SSE Mid Cap Index ● SSE

C 000065 SSE Industry Top Index ● SSE

H 0001500 Hang Seng China Affiliated Corporations Index ● HSDS

H 0001400 Hang Seng China Enterprises Index ● HSDS

OMD-C MMDH Interface Specifications Appendix A - List of Indices and Market Information Under OMD Index

© Copyright 2019 HKEX 61/61

H 0000100 Hang Seng Index ● HSDS

H 0000101 HSI Sub Indices – Finance ● HSDS

H 0000102 HSI Sub Indices – Utilities ● HSDS

H 0000103 HSI Sub Indices – Property ● HSDS

H 0000104 HSI Sub Indices – Commerce & Industry ● HSDS

H 0105000 HSI Volatility Index (VHSI) ● HSDS

H 0200700 Hang Seng Mainland Banks Index ● HSDS

H 0200800 Hang Seng Mainland Properties Index ● HSDS

H 0201000 Hang Seng Mainland Oil and Gas Index ● HSDS

H 1006800 Hang Seng Index (Gross Total Return Index) ● HSDS

H 1006801 Hang Seng Finance Sub-Index (Gross Total Return Index) ● HSDS

H 1006802 Hang Seng Utilities Sub-Index (Gross Total Return Index) ● HSDS

H 1006803 Hang Seng Properties Sub-Index (Gross Total Return Index) ● HSDS

H 1006804 Hang Seng Index Commerce & Industry Sub-Index (Gross Total Return Index) ● HSDS

H 1007200 Hang Seng China Enterprises Index (Gross Total Return Index) ● HSDS

H 2006800 Hang Seng Index (Net Total Return Index) ● HSDS

H 2006801 Hang Seng Finance Sub-Index (Net Total Return Index) ● HSDS

H 2006802 Hang Seng Utilities Sub-Index (Net Total Return Index) ● HSDS

H 2006803 Hang Seng Properties Sub-Index (Net Total Return Index) ● HSDS

H 2006804 Hang Seng Index Commerce & Industry Sub-Index (Net Total Return Index) ● HSDS

H 2007200 Hang Seng China Enterprises Index (Net Total Return Index) ● HSDS

S SPHKG S&P/HKEX GEM Index N/A

S SPHKL S&P/HKEX LargeCap Index N/A

T RXYH TR/HKEX RXY Global CNH ● TR

T RXYY TR/HKEX RXY Global CNY ● TR

T RXYRH TR/HKEX RXY Reference CNH ● TR

T RXYRY TR/HKEX RXY Reference CNY ● TR

T HKGDUER HKEX USD Gold Futures – Excess Return Index N/A

T HKGDUTR HKEX USD Gold Futures – Total Return Index N/A

T HKGDUSP HKEX USD Gold Futures – Spot Price Index N/A

T HKGDRER HKEX CNH Gold Futures – Excess Return Index N/A

T HKGDRTR HKEX CNH Gold Futures – Total Return Index N/A

T HKGDRSP HKEX CNH Gold Futures – Spot Price Index N/A

Note 1: For indices with the index source = C, in the event there is service outage in the HKEX primary data center and restart of OMD-C at the secondary data center, real-time dissemination of CSI and CES index data will be suspended until service resumption of the HKEX primary data center.

Abbreviation:

CES = China Exchanges Services Company Limited

CSI = China Securities Index Company Limited

HSDS = Hang Seng Data Services Limited

HSI = Hang Seng Indexes Company Limited

S&P = S&P Dow Jones Indices

TR = Thomson Reuters Hong Kong Limited