Documente Academic
Documente Profesional
Documente Cultură
For
TP Manager Connectivity
Version 1.0
March 2008
Contents
Cancel Shares 72
Ceiling Price 72
Client ID 72
Client ID Required 72
Confirm Number 74
Contact 74
Contra Firm 74
Current Room 74
Deal ID 74
Declines 75
Delist 75
Down Volume 75
Error code 75
Filler 76
Firm 76
Floor Price 77
Halt / Resume Flag 77
Highest Price 77
Index – HOSE 77
Index Time 77
Last Sale Price 78
Lot Volume 78
Lot Volume 1,2,3 78
Lowest Price 78
Market ID 78
Message Type 79
Meeting 79
Mutual Fund Volume 79
No Change 79
No Change Volume 79
Notice 80
Open Price 80
Order Cancel Status 80
Order Entry Date 80
Order Number 81
Original Message Text 81
Par Value 81
Port/Client Flag 81
Price 82
Price 1,2,3 82
Prior Close Date 82
Prior Close Price 82
Projected Open Price 83
Published Volume 83
Reject Reason Code: 83
Reply Code 84
SDC Flag 84
Sector Number 84
Security Name 85
Security Number, Security Number (New) 85
Security Symbol 85
Security Type 85
Side 86
Split 86
Suspension 86
System Control Code 86
Time 87
Timestamp 87
Total Room 87
Total Shares Traded 87
Total Trades 87
1. Introduction
2. Theory of Operation
The Trading System at an exchange can be divided logically into 2 parts: front-end and back-
end. The back-end system is where trading application resides. The trading transactions are
transferred as messages between the back-end system at the exchange and the broker trading
system. It is the responsibility of the front-end system to handle the message transfer with full
awareness of the underlying transport protocol. The front-end may also act as a message router
when there is more than one back-end system, e.g. each supporting a particular market. The
application protocol is used for the front-end system to transfer trading messages over the
transport protocol in a reliable and manageable manner.
Theoretically, TCP, the underlying transport protocol of AUTO-tP, is a reliable protocol, e.g.
there is no packet loss nor duplication, and no packet is out of sequence. However, the abrupt
session breakdown might cause data loss; thus, making the TCP unreliable in the application
point of view. The reason is that TCP makes use of sliding window. The last unpacked TCP
packets may reach or may not reach the destination during the abnormal session breakdown. If
the new session is intended to continue the previous breakdown, it requires an application to
remember the "state" of the last session. Such state information is any information that enables
an application to differentiate the packets of the current session from those of the previous
session. Typically, the state is the packet sequence. The packet sequence is not required to be
unique throughout the whole session when sliding window is employed but in AUTO-tP, the
packet sequence will be unique for other reference purposes. Considering the state of an
application, there are 3 possible modes (situations) in making a connection:
mode A (new connection): when an application intentionally forgets the previous state.
mode C (continued connection): when an application uses the previous state to recover the
session. This is the successful continuing session.
mode B (blindly continued connection): when an application loses the state but tries to
recover the session with the state information from the partner. The example situation when
an application needs mode B connection is when the host on which an application is
running is down.
There will be no mode B1 if an application does not lose the state; for example, if it saves the
state information on a non-volatile storage. However in the case that an application is moved
from one host to be executed on another host. The application must be able to access the saved
state information from the new host. Therefore the state information has to be stored on the like
of shared disk. Unfortunately, the shared disk approach might not be possible if the two host are
located in different geography.
Both sides have to agree upon the mode connection they will establish in advance, otherwise
the session can not be continued properly. For example, it is impossible if a server expects a
connection in mode A while a client wants to make a connection in mode C. Furthermore, the
data recovery procedure must be immuned to the recurring of possible breakdown during the
current recovery procedure itself.
In AUTO-tP, an exchange will act as a server and a broker will act as a client. The relationship
is one-to-one. Briefly, the application protocol consists of 3 major phases:
1. Connection establishment : In this phase, the client will request a connection to the server.
Before the server accepts the request connection, it will authenticate the requesting client
and do the client-side data recovery if necessary. Upon the connection acceptance from the
server, the client has to check if the server-side data recovery is required and send a
confirmation.
2. Data transfer : Once the connection is legally established, either server or client can send
data packets to each other. This phase is full-duplex but works under the sliding window
flow control. The flow control will limit the number of data packets that each side can send
to another without reception of any response. Other command-response subprotocols can
be implemented in the data transfer phase.
3. Connection termination: When either side prepares to stop the session, if possible, it must
follow the application protocol before closing the transport connection.
Besides the aforementioned reliability issue, the application flow control makes the protocol
manageable in that:
the number of packets that may be lost during an abnormal breakdown will not be more
than the size of the buffered window; thus, the recovery time can be controlled at the
application level.
if the application are not ready to receive any more packet for any reason, the data transfer
can be suspended at its will, otherwise the overloaded side may crash after all.
3. AUTO-t Protocol
1For the current front-end system at HOSE, the situation B can happen because the state
information is kept in the memory. Though all messages are logged onto disks, only data
portion of each front-end message which includes packet sequences is logged. For DECnet
protocol, the line handler uses a heuristic to recover data while the line handler for X.25 choose
to accept possible data loss if the case happens. The heuristic used by DECnet line handler is to
send the last N packets, each with a flag indicating possible duplication, where the N is the size
of the output window. (Also see "uncertainties" in the appendix B)
Content
opcode or packet type (2 field-name field-length
chars)
HL (HELLO) mode 1 byte ( alphabet )
A = new connection
B = forced continued
connection
C = continued connection
password N bytes
EOS (End Of String, ASCII 1 byte
code 00)
number of markets 1 byte (mod96+32)
market ID-1 1 byte (alphabet)
A = ASSET
(subjected to change)
firm ID-1 3 bytes (alphabet)
... ...
market ID-n 1 byte (alphabet)
firm ID-n 3 bytes (alphabet)
HR (HELLO_REPLY) mode 1 byte (alphabet)
CF (CONFIRM) - -
DT(DATA), market-ID 1 byte (alphabet)
message-count 1 byte (mod96+32)
data N bytes (if there are more
than one backend messages,
each will be separated with
US character)
LO(LEFTOVER) market-ID 1 byte (alphabet)
LL(LEFTOVER_LAST)
of DT
message-count 1 byte (mod96+32)
data N bytes (if there are more
than one backend messages,
each will be separated with
US character)
LO(LEFTOVER) market-ID 1 byte
LL(LEFTOVER_LAST)
of RP
RP Packet “RP” = 2 bytes
Link id = 2 bytes
Market-ID = 1 byte
Broadcast message = N bytes
RR(RETRAN_REQ) market-ID 1 byte
broadcast request message N bytes
RP(RETRAN_REPLY) market-ID 1 byte
broadcast message N bytes
AK(ACK) - -
NK(NACK) error code 2 bytes ( mod96+32 )
error string N bytes
EOS (ASCII code 00 ) 1 byte
FN(FINISH) - -
AF (ACKFIN) - -
EC (ECHO) - -
ER (ECHO_REPLY) - -
The connection establishment phase includes first-time authentication and data recovery (if
there's any message loss from the last session).
For the case (d) It may be either because the server machine had been down or because the
server chose new connection (mode A, see Section 2) while the client chose to continue
connection (mode C). For the later case, the protocol should stop. Note that HOSE has chosen
not to recover missing data if the mode B connection happens but simply to recover sequences.
(See "uncertainties" in App.B). The case (c) should never happen if both applications are
correctly implemented. If it happens somehow, the protocol must stop.
d) If CliSeq < ServAck then there is something wrong with the client.
For the case (d), it maybe either because the client machine had been down or because the
client chose new connection (mode A) while the server chose to continue connection (mode
C). For the later case, the protocol should stop. The case (c) should never happen if both
applications are correctly implemented. If it happens somehow, the protocol must stop.
3.2.1.5 Once the server gets CONFIRM from the client, the connection setup phase is
complete.
3.2.2 Authentication
The front-end system of the exchange will maintain the following database:
N
1
1
Link ID 1 1 Entran ce
(M em b er ID ) P assw o rd
Perm issible
M arkets
The link ID is for identifying a broker that connects to an exchange system. In the HELLO
packet, a client will place an entrance password and all (market-ID,firm-ID) tuples it wants to
trade with. Note that this password is for all markets the broker is allowed to trade with.
Password encryption can be employed here. If the password as well as a client’s IP are valid, a
server continues the connection setup process; otherwise, a NACK packet will be sent. Then
during the data transfer state, each data packet from a certain link ID which contains a market-
ID will be checked. If it is a data packet destined to a market where that broker has no
permission to access, the packet will be discarded and an exchange will issue NACK. Note that
the front-end system will no longer check whether a data packet contains a proper firm-ID.
Data transfer phase includes Data transfer and Command-Response Service. In the Data
transfer state, the protocol entity will apply sliding window to all data packets. Also in this
state, there can be any command/response sub-protocol. Typically, the client sends a command
to the server and the server responses by sending ACK or NACK. Such sub-protocols are such
as broadcast retransmission request and Echo request, etc. If any data packet is invalid, the
exchange will respond with NACK.
Here at the application level, sliding window is used only to control the data flow between the
sender and the receiver. It is not for reordering incoming data packets nor for detecting message
loss and duplication because the underlying transport protocol has already handled such
problems. Each side can send as many data packets as the size of the output window without
reception of any ACKnowledged packet. The recipient should not send an explicit ACK until its
input window gets full. Each data packet being sent also implies acknowledgement of reception
of data packets of the other side so far, i.e. an ACK packet is piggybacked on an outgoing
DATA packet. Every packet will contain a sequence number and an acknowledged sequence
number and the following condition must always be satisfied:
theirAckSeq < ourNextSeq <= theirAckSeq+WindowSize
A broker system can request broadcast data retransmission during the data transfer state with a
packet RETRAN_REQ. The packet carries a broadcast request message. An exchange will
respond with either ACK if the request packet is not invalid or NACK otherwise. Note that the
ACK/NACK
By sending an ECHO packet, either side can check the reachability to the other side or the
readiness of the other side, e.g. whether the other side is staying in the data transfer phase,
ready to transfer DATA packets. To assume the guarantee of reachability or readiness, the
program must receive an ECHO_REPLY packet as a response.
window accordingly.
12
rcv: CONFIRM server
snd: COMAND command
ECHO
rcv/snd: DATA,
ACK, NACK 11 rcv: ACK, NACK,
data ECHO_REPLY
transfer
rcv: COMMAND,
ECHO
State
1. RCV_HELLO
2. CLI_RECOV_BEGIN
3. CLI_RECOV_CONT
4. CLI_RECOV_END
5. SERV_READY
6. SERV_ACCEPT
7. SERV_RECOV_BEGIN
8. SERV_RECOV_CONT
9. SERV_RECOV_END
10. CLI_READY
11. DATA_TRANSFER (or CLI_ACCEPT)
12. SERV_COMMAND
13. CLI_COMMAND
14. RCV_FIN
15. SND_FIN
In any state of the whole protocol state diagram, if the server receives a new transport
connection request, it will assume the demise of the last session and reset the state to the
starting one, ready for the connection in the continuing mode (mode C).
application3.)
When the protocol breaks (e.g. it is out of state);
When a certain packet is out of sequence (.e.g. the sequence of the packet is not
consecutive to the last one);
The size of an input and output window should be the same. The definite size somehow
cannot be determined at the time when this document is being written since the window
size affects the performance, latency, and recovery time directly.4
For each DATA packet, it is up to implementers to let it carry single or multiple back-end
dependent messages but both sides must have the same agreement.
The maximum size of an AUTO-tP packet should not be more than the smallest MTU of all
network equipments with TCP/IP stacks in the whole path5.
4. Code Description
Transport Connection
HELLO_REPLY
LEFTOVER
ACK
...
LEFTOVER_LAST
ACK
CONFIRM
DATA/ACK/NACK
Connection Setup
DATA
Server Client
(Exchange) (Broker)
Data Transfer
or
NACK
Transport Disconnect
Connection Termination
1. Introduction
The Broadcast Protocol is a messaging protocol used for market data delivery to all trading
participants.
2. Message Deliver
The Broadcast messages are sent in the Broadcast packet form. One Broadcast packet can
contain multiple Broadcast messages. Broadcast packets are sent via the Universal Datagram
Protocol (UDP).
Broadcast packets can be identified by their sequence numbers. TP sends Broadcast packets
with a sequence series starts at 1 (one). Receivers use the sequence numbers to detect duplicate
messages or lost messages and issue the proper retransmission process.
In case TP needs to restart the Broadcast packet with sequence at 1 (one). The receivers should
have a utility to reset the received sequence number to 1 (one). And in case of unrecoverable
situation, the receivers should have a utility to skip the lost packet to continue the current
trading session.
2.2 Timestamp
During periods of message inactivity, TP will send Time Stamp message at regular time
intervals, currently used interval is 30 seconds.
The Time Stamp messages is TS message.
The packed content format consists of Broadcast messages separated by US character (ASCII
31 or 0x1F). The grey text is optional fields.
3. Broadcast Retransmission
Because of the nature of UDP, Broadcast packets may be duplicated or may be lost. If
incoming sequence numbers are lower than the receiver’s next expectation, they are duplicated
and the receivers can discard those packets. If a sequence gap occurs, some packets are lost
and the receivers should issue the retransmission process.
Receivers can request Broadcast packet retransmission via an Auto-t protocol with a CTCI-RQ
message.
If the request is invalid, TP will respond with a CTCI-RN message.
The followings are the retransmission criteria.
- At most 600 sequences per request.
- The start sequence of the current retransmission request must be more than the end
sequence of the previously successful retransmission request.
If the request is valid, TP will resend Broadcast messages in CTCI-RP messages. The
UnitSeparator characters in the original Broadcast packets are changed to BELL characters.
Timestamp messages (CTCI-TS) are not resent. But the Timestamp message is used for end-
of-retransmission notification. Please note that the Timestamp field in the end–of-
retransmission Timestamp message has the value of Mod96(Retransmission End Sequence),
not Mod96(HHMMSS). The grey messages in the Figure 1 are optional.
The details of the broadcast retransmission request and reply messages (RQ, RP, RN
and TS) are specified in Part “Message Specification”.
Server Client
TP Broker
Broadcast packet lost
detected
CTCI-RQ
Valid request
CTCI-RP
:
:
CTCI-RP
CTCI-RP(TS)
Server Client
TP Broker
Broadcast packet lost
detected
CTCI-RQ
Invalid request
CTCI-RN
Receiver system’s operators can request Broadcast packet retransmission by calling to the
Exchange systems’ operators and specifying the packet sequences to be resent.
Message 1E - Advertisement
Field Size Type
1. Message Type 2 "1E"
2. Firm 3 Numeric String
3. Trader ID 4 Alphanumeric String
4. Security Symbol 8 Alphanumeric String
5. Side 1 Alpha String
6. Volume 8 Numeric String
7. Price 12 Numeric String
8. Board 1 Alpha String
9. Time 6 Numeric String
10. Add/Cancel Flag 1 Alpha String
11. Contact 20 Alphanumeric String
Total 66
remark
For every Order Change Message accepted by the HOSE’s trading system,
a Confirm of Order Change Message will be sent to the originating
firm. The Order Number and Order Entry Date will identify the order
that was changed. Other fields in this message will contain the
current values for the order including the new updated order
information. This message will also be used to inform a broker firm of
the limit price assigned to a market price order, which has been
partially filled. (In this MP case, published volume is blank, Price
is changed to limit price.)
This message is sent to the contra broker when a Two Firm Put-through
Deal Message is received by the HOSE. This message is sent to the
contra firm (buyer) so the deal details may be checked. The buyer
must then send a Put-Through Deal Reply to approve or disapprove the
deal details.
Message 2G - Reject
Field Size Type
1. Message Type 2 "2G"
2. Firm 3 Numeric String
3. Reject Reason Code 2 Numeric String More codes
4. Original Message Text 233 Depend size of
message type
Total 240
Message 3A - Admin
Field Size Type
1. Message Type 2 "3A"
2. Firm 3 Numeric String
3. Trader ID (sender) 4 AlphaNumeric String
4. Trader ID (receiver) 4 AlphaNumeric String
5. Contra Firm 3 Numeric String
6. Admin Message Text 66 AlphaNumeric String
Total 82
The Admin Message is a free format message that may be sent from one
firm to another, from one firm to the HOSE, or from the HOSE to a
firm. The Contra Firm field should be filled with zeroes if the
message is to be transmitted to the HOSE. The Contra firm field will
contain zeroes for admin messages transmitted from the HOSE to a
broker. The Trader ID (sender) field is required and must contain the
ID of the user who sent the admin.The Trader ID (receiver) field is
optional and is used to address admins to a specific user at another
broker firm.
Reply Code
A = Approve
C = Contra Disapprove
S = HOSE Disapprove
HOSE will not check “Side” in message 3C, if other fields is validated
correctly by HOSE system. “Side” in original message by seller will be
forwarded to buyer.
This message will be sent back to the originator including with the
error code and original test when a retransmission request is
incorrected. The rejected reason is described in an error code.
This message is sent during EOD to help broker reconcile their trading
data. It tells each broker how many shares and how much money they
have bought and sold up to that point.
SC message (Code G)
SU,...,SU messages (1 for each security)
SC message (Code J)
(about 3 minutes later)
SC message (Code T)
BR,...,BR messages (1 for each broker)
SC message (Code U)
Message "End-of-Day Broadcast Transmissions Complete"
Message "Begin End-of-Day Procedure Now"
LS that has been actuated by pre-open market match will be sent out
with Side=‘ ‘. LS that has been actuated by open market match will be
sent with side = contra side ( if buy order make a transaction, LS
will be sent out with side = ‘S’ )
Each news headline and the associated story will be assigned a unique
news story number by the HOSE trading system. If the News relates to
a particular security, This message is sent at the same time as its
related News Story Message. Note: a news headline MUST have a related
news story.
This message is sent whenever a new odd-lot order arrives at the HOSE.
It is broadcast to all brokers so they can update their book. Note
that this is different from the way a main board order is handled.
One Market Open Last Sale Message will be broadcast for each issue
during the opening cycle. If no matches take place in a security at
the open, a last sale message will be sent out with the price of zero.
In this case, a later deal in this issue will cause this message to be
sent out to indicate the eventual first last sale (to be considered
the opening price).
A Market Open Last Sale Message will be broadcasted twice a day during
the market open cycle.
SU messages are sent during EOD to give the closing information of all
securities. This message is never sent during trade.
The sequence of the broadcast messages during EOD will be:
SC message (Code G)
SU,...,SU messages (1 for each security)
SC message (Code J)
For SU message transmitted after market closes, all fields are values
announced to support tomorrow trading. If the security is not traded
on that day, field Last Sale Price will be the same as Prior Close
Price.
If the security has already listed in the HOSE, Field Security Number
and Security Number (New) will be always the same.
In case of new stock, Security Number and Security Number (New) will
be different. The Field: Security Number (New) will contain security
number of new stock and be sent through SU message (after market
closed) 1 day in advance while the Field: Security Number will be
blank.
This message is sent whenever there are any changes in top three bid /
offer prices or volume of a security. Anyway, from time to time,
this message will be periodically sent out the prices / volume of all
stocks that do not have any changes in their top three prices.
According to the At-The-Open (ATO) and At-The-Close (ATC) orders are
queued for matching prior to “Limit-Price Order”, the bid / ask prices
of ATO and ATC orders will be first transmitted (1st Best Bid/Offer).
Their prices will be transmitted as zero (0) while the volumes will
not be zero (0).
To display the price of ATO and ATC orders on the displayed screens,
the HOSE would like to ask the members a cooperation to display the
price as follows:
To display the price as “ATO” for all orders sent during Pre-
Open sessions (both morning and afternoon sessions) that specify
price as opening price.
To display the price as “ATC” for all orders sent during the
Call Market period (in afternoon session) that specify price as
closing price.
This message will tell you how many rooms are available for you and it
will be generated for each match.
Add/Cancel Flag
A 1 character alpha field that indicates whether the transaction
should be added to or removed from the trading data files.
Possible values:
"A" Add
"C" Cancel
CTCI: 1E
Broadcast: AA
Advances
A 2 character numeric field in modulo-96 format that indicates the
number of securities that is up in price for the day. This is
compared against the closing price of the previous trading day.
Possible Values:
0 <= n <= 9,215
CTCI: None
Broadcast: IU
Benefit
A 1 character alphabetic field which indicates that a security is
trading without (Ex) the previous benefit.
Possible values:
" " Not Applicable
"A" Ex-Dividend and Ex-Rights
"D" Ex-Dividend
"R" Ex-Rights
CTCI: None
Broadcast: SU, SS
Board
A 1 character Alpha field that identifies the trading board.
Possible Values:
"B" Big-lot board
"M" Main board
"O" Off-hour board
Board Lot
A 2 character numeric field in modulo-96 format that indicates the
board lot size (number of shares required to make one lot) of a
security.
Possible values:
1 <= n <= 9,215
CTCI: None
Broadcast: SS, SU
Possible values:
1 <= n <= 84,934,655 (encoded integer)
Cancel Confirm
A 6 character numeric field that identifies the confirm number of a
deal that is to be cancelled or corrected. (see Confirm)
CTCI: 3C, 3D
Broadcast: None
Cancel Shares
An 8 character numeric field used to indicate the number of shares
that were successfully cancelled from the order. If the order has not
been matched, this should be the total volume. If the order has been
partially matched, this should be the remaining leaf.
CTCI: 2C
Broadcast: None
Ceiling Price
A 4 character numeric field in modulo-96 format that contains the
highest price at which a security may trade on the Main board for the
next trading day. Same format as price field. Ceiling price is
represented in units of 1/100 point. Thus the actual ceiling price
value is computed by dividing the value by 100. (see Price)
CTCI: None
Broadcast: SS, SU
Client ID
A 10 character alphanumeric field that will contain the Client Account
ID used internally by the broker firm. This information is required as
defined in the HOSE’s rules.
Possible values:
- The first three Char is broker no or custodian
- The fourth Char is corresponding to pc flag.
- The rest of Char is other value.
- No Space
M B custodian symbol
F F custodian symbol or broker
no
F E foreign custodian symbol
Client ID Required
A 1 character alpha code associated with a security. When this code
is set to "Y", all orders input for this security must contain the
Client ID.
Possible values:
" " Not Applicable (Client ID not required)
"Y" Client ID required on all new orders input for this security
CTCI: None
Broadcast: SS, SU
Confirm Number
A number assigned by the HOSE’s system, which is used to uniquely
identify every deal. All subsequent references to that deal will use
confirm number to identify the deal.
Possible Values:
1 <= n <= 884,735
Contact
A 20 characters field indicates broker’s contact person and telephone
number.
CTCI: 1E
Broadcast: AA
Contra Firm
A 2 character numeric field that indicates the firm on the opposite
side of a deal or message. (see Firm)
Possible Values:
1 <= n <= 9215 < if 2 bytes Mod-96 >
1 <= n <= 999 < 3 bytes Numeric String >
Current Room
A 6-byte numeric field in modulo-96 format that identifies the number
of current room left after executing.
Possible values:
0 <= n <= 782,757,789,695
CTCI: None
Broadcast: TR
Deal ID
A 5 digit numeric field whose value is assigned by the Broker System
when a One or Two Firm Put-Through Deal is entered. HOSE’s trading
system returns the Deal ID on various messages to assist the Broker
System in looking up the original Put-Through record. The HOSE’s
system does not check the Deal ID.
From DCTERM, Deal ID is Blank.
Declines
A 2 character numeric field in modulo-96 format that indicates the
number of securities that are down in price for the day. This is
compared against the closing price of the previous trading day.
Possible Values:
0 <= n <= 9,215
CTCI: none
Broadcast: IU
Delist
A one character Alpha field indicates flag in a security.
Possible values:
" " Not Applicable
"D" Delist Security, the security is delisted (unavailable in
exchange)
CTCI: None
Broadcast: SS, SU
Down Volume
A 6 character numeric field in modulo-96 format that contains the
total shares traded so far today in securities which are down in
price. Down volume is represented in units in 1,000. Thus the actual
down volume value is computed by multiplying the value with 1,000.
Possible values:
0 <= n <= 8,153,726,975
CTCI: None
Broadcast: IU
Error code
A 2-byte numeric field that indicates an error of retransmission to
indicate where an error was detected by the HOSE system.
Possible values:
1 <= n <= 99
01 Illegal RQ Length
02 Illegal RXMT message type
03 Illegal Broker No
04 Repetition RXMT request > maximum limit
05 Start Sequence > End Sequence
06 Last RXMT sequence >= Start Sequence
07 No. of RXMT sequence (End - Start) > Maximum Limit
08 Broadcast log file is null
09 End Sequence > Last Sequence of HOSE
10 Not found start sequence
99 Undefined Error
CTCI: RN
Broadcast: none
Filler
A set of blank character contains no information.
Firm
Current firm number assignments (as defined by the HOSE) are used.
This field identifies the firm sending or receiving the message.
Possible values:
1 <= n <= 9215 < if 2 bytes Mod-96 >
1 <= n <= 999 < 3 bytes Numeric String >
Floor Price
A 4 character numeric field in modulo-96 format that contains the
lowest price at which a security may trade on the Main board for the
next trading day. Same format as price field. Floor price is
represented in units of 1/100 point. Thus the actual floor price value
is computed by dividing the value by 100. (See Price)
CTCI: none
Broadcast: SS, SU
Possible values:
" " Not Applicable
"H" Halt in both AOM and PT
“A” Halt in AOM transaction
“P” Halt in PT transaction
CTCI: None
Broadcast: SU, SS
Highest Price
A 4 character numeric in modulo-96 format that contain the highest
price created by auto-matched deal in the Main Board of the security
for the trading day. Highest price is represented in units of 1/100
point. Thus the actual highest price value is computed by dividing the
value by 100.
Possible values:
See Price
CTCI: None
Broadcast: SU
Index – HOSE
A 4 character numeric field in modulo-96 format that indicates the
value of the corresponding index. Index value is represented in units
of 1/100 point. Thus the actual index value is computed by dividing
the value by 100.
CTCI: None
Broadcast: IU
Index Time
A 3 character numeric field in modulo-96 format that indicates the
time sending index.
CTCI: None
Broadcast: IU, SI
CTCI: None
Broadcast: SU
Lot Volume
A 4-byte numeric field in mod-96 indicating volume of trading shares
in board lots.
Possible values:
0 <= n <= 84,934,655 (4-byte)
CTCI: None
Broadcast: LS
Possible values:
0 <= n <= 84,934,655
CTCI: None
Broadcast: TP
Lowest Price
A 4-byte numeric field in mod-96 indicating the lowest price created
by auto-matched deal in the Main Board of the security for the trading
day. Lowest price is represented in units of 1/100 point. Thus the
actual lowest price value is computed by dividing the value by 100.
Possible values:
See Price
CTCI: None
Broadcast: SU
Market ID
A 1-byte alpha string field which identifies a specific type of
market.
Possible values:
"A" SET
CTCI: None
Broadcast: IU, SU
Message Type
A 2-byte alpha string field which identifies a specific type of
message in system.
CTCI: All
Broadcast: All
Meeting
A 1 character alpha string field indicates meeting sign.
Possible values:
“M” Ex-Meeting
“ “ Not Applicable
CTCI: None
Broadcast: SS, SU
No Change
A 2 character numeric field in modulo-96 format that indicates the
number of securities that are not changed in price for the day. This
is compared against the closing price of the previous trading day.
Possible Values:
0 <= n <= 9,215
CTCI: None
Broadcast: IU
No Change Volume
A 6 character numeric field in modulo-96 format that contains the
total shares traded so far today in securities that their prices are
not changed. No change volume is represented in units in 1,000. Thus
the actual no change volume value is computed by mutiplying the value
with 1,000.
Possible values:
0 <= n <= 8,153,726,975
CTCI: None
Broadcast: IU
Notice
A 1 character alphabetic field that indicates that a security has been
asked to provide important information or has responded to a request
for information.
Possible values:
" " Not Applicable
"P" Notice Pending
"R" Notice Received
CTCI: none
Broadcast: SS, SU
Open Price
A 4 character numeric field in modulo-96 format contains the price at
which the security traded of the day. Open price is represented in
units of 1/100 point. Thus the actual open price value is computed by
dividing the value by 100.
Possible values:
see Price
CTCI: None
Broadcast: SU
Possible values:
" " Cancelled by Broker
"S" Cancelled by HOSE
CTCI: 2C
Broadcast: None
Order Number
A unique 8 characters number assigned by the firm which is used to
identify each of the firm's orders. This field is not checked by the
HOSE system but is maintained as a way for the firm to internally
identify its orders. (Note that the range of values for this field
is restricted.)
Possible values:
1 <= n <= 84,934,655
CTCI: 2G
Broadcast: None
Par Value
A 4 characters numeric in modulo-96 indicates par value of a security.
Par value is represented in units of 1/100 point. Thus the actual par
value is computed by dividing the value by 100.
CTCI: None
Broadcast: SU
Port/Client Flag
A 1 character Alpha field used to indicate whether an order is traded
on behalf of the broker's /sub-broker's portfolio, or for a client.
Possible values:
"C" Broker Client
"F" Broker Foreign
"M" Mutual Fund
"P" Broker Portfolio
Price
Indicates the price of an order or deal. Prices may be whole numbers
or decimal numbers depending on how the issue involved is traded. For
example, 54.25 is valid as well as 1250. Alpha values are only
allowed in the case of ATO or MP orders.
Possible values:
"ATO" At The Open
OR "ATC" At The Close
OR "MP" Market Price (orders only)
OR 1 <= n <= 849,346 (for Broadcast)
OR 1 <= n <= 999,999.999999(for 1E, 1F, 1G, 2F, 2L,AA)
OR 1 <= n <= 99,999.99 (for 1I)
OR 1 <= n <= 99,999.99 (for 2D, 2E, 2I)
Price 1,2,3
A 4 character numeric field in modulo-96 format that contains top 3
bids and offers prices that the HOSE broadcast to brokers. Price 1 is
the best bid. Price 2 is the second best. And Price 3 is the third
best. Price 1,2,3 price is represented in units of 1/100 point. Thus
the actual price 1,2,3 value is computed by dividing the value by 100.
CTCI: None
Broadcast: TP
Possible values:
20070312
CTCI: None
Broadcast: SU
Possible values:
CTCI: None
Broadcast: SS, SU
The third transmission will be during the call market period and the
Message PO will be broadcasted as the ‘projected close price’ instead
of ‘projected open price’
Possible values:
1 <= n <= 84,934,655 (encoded integer)
CTCI: None
Broadcast: PO
Published Volume
An 8 character field that indicates how many shares of an order are
available to the market.
Possible values:
1 <= n <= 84,934,655 (encoded integer)
Possible values:
00 “MP order without contra-side”
01 “Illegal price spread”
02 “Incorrect volume for specified board”
03 “Illegal request - Market Closed”
04 “Incorrect Stock Symbol”
05 “Incorrect Firm”
06 “Incorrect Trader ID”
07 “Incorrect confirm number”
08 “Too late to perform requested action”
09 “Incorrect Reference Number”
10 “Incorrect Conditions”
11 “Trading halted in Stock”
12 “Incorrect Board”
13 “Missing Client ID”
14 “Incorrect Order Type”
15 “Incorrect Port / Client flag”
16 “Incorrect Request Code or Reply Code”
17 “Incorrect Side: must be Buy or Sell”
18 “Incorrect Order Number”
19 “Incorrect Time”
20 “Incorrect Date”
24 “Security suspended”
25 “Missing P/C Flag”
27 “No available room for Thai Trust Fund”
28 “Market in Intermission”
29 “Market Halted”
31 “Changing Deal information disallowed”
33 “Trading disallowed for this stock”
34 “Incorrect price - above ceiling”
35 “Incorrect price - below floor”
36 “Put-Through price incorrect format”
37 “Cancel of automatch deal disallowed”
38 “Incorrect Volume for Put-Through deal”
41 “Illegal Market ID”
42 “Illegal Message Type/Header”
43 “Illegal Message Length”
44 “Incorrect Customer ID”
45 “Wrong Filler Value”
99 “Unidentified Error”
CTCI: 2G
Broadcast: None
Reply Code
A 1 character alpha field used to reply to a request for cancellation
or correction of a deal.
Possible values:
"A" Approval
"C" Contra broker disapproval
"S" HOSE disapproval
CTCI: 3B, 3D
Broadcast: None
SDC Flag
A flag to indicate if the security is in SDC. This field was added in
ASSET V3.0.
Possible values:
"Y" Security in SDC
"N" Security not in SDC
CTCI: None
Broadcast: SU
Sector Number
Possible values:
0 <= n <= 95
CTCI: None
Broadcast: SS, SU
Security Name
A 25 character alphanumeric field that contains the full name of
a security. Name must begin with an letter A-Z. Name may include
blank and hyphen (-).
CTCI: None
Broadcast: SU
Possible values:
1 <= n <= 4000 (encoded integer)
CTCI: none
Broadcast: AA, DC, LE, OS, PD, PO, SS, SU, TP, TR
Security Symbol
An 8 character alphanumeric field that contains the security symbol
that is used by the HOSE.
Security Type
A 1 character alphabetic field that indicates the type of security.
Possible values:
"D" Debenture
"S" Common Stock
"U" Unit Trust
CTCI: None
Broadcast: SS, SU
Side
1 character Alpha field that specifies the buying or selling side of
a transaction. This field is left blank on deal confirmation messages
that result from one firm put-through deals.
Possible values:
"X" Firm is both buyer and seller (for 2L)
"B" Buy
"S" Sell
Any value for “3C” since HOSE system will not validate side in “3C”
message
Split
Indicates that the security is trading for the first day after a stock
split has taken place.
Possible values:
" " Not Applicable
"S" Split
CTCI: None
Broadcast: SS, SU
Suspension
A one character string indicates that trading in a security has been
suspended indefinitely.
Possible values:
" " Not Applicable
"S" Security Suspended
CTCI: None
Broadcast: SS, SU
Possible values:
" " Not Applicable
"A" Start of Recap stream, Start of Call Market
"C" Market Close, Begin Runoff Period
"F" Finish Intermission Period
"G" Begin EOD Security Update Transmission
"H" Halt all Trading
"I" Begin Intermission Period
"J" End EOD Security Update Transmission
"K" End Runoff Period
"N" Normal Trading resumed for a specified security
"O" Market Open
"P" Start of Preopen period for entire market
"R" Resume all trading
"X" Orders are not being accepted for specified security
CTCI: None
Broadcast: 1 byte. SC, SS
Time
A 6 character numeric field in the format "HHMMSS". Hours are
identified based on a 24 hour clock.
CTCI: 6 bytes. 1E
Broadcast: 3 bytes (Mod-96) AA.
Timestamp
A 3 characters string in modulo-96 indicates the time a message was
sent from the HOSE side. Timestamp format
is "HHMMSS" in 24-hour format.
CTCI: None
Broadcast: SC
Total Room
A 6-byte numeric field in Modulo-96 format that contains the total
room reserved for investor in case of Foreign Room.
Possible values:
0 <= n <= 782,757,789,695
CTCI: None
Broadcast: TR
Possible values:
1 <= n <= 8,153,726,975
CTCI: None
Broadcast: IU, SU
Total Trades
A 4 character numeric field in Mod-96 format that contains the total
number of deals made so far today.
Possible values:
1 <= n <= 84,934,655 (encoded integer)
(See Confirm Number field which max at 884,735)
CTCI: None
Broadcast: IU
Possible values:
1 <= n <= 8,153,726,975
CTCI: None
Broadcast: IU, SU
Trader ID
A 4 character field that identifies a specific user. Current Trader
ID number assignments (as defined by the HOSE) are used. This field
identifies the individual trader, as registered with the HOSE,
authorized to use the trading system.
Possible values:
xxxx : x = 0-9
Up Volume
A 6 character numeric field in modulo-96 format that contains the
total shares traded so far today in securities which are up in price.
Up volume is represented in units in 1,000. Thus the actual up volume
value is computed by multiplying the value with 1,000.
Possible values:
0 <= n <= 8,153,726,975
CTCI: None
Broadcast: IU
Volume
The number of shares for equity securities and the number of bonds for
debt securities that changed hands during the trading period.
Possible values:
1 <= n <= 84,934,655 (encoded integer)
CTCI: 8 bytes 1E, 1I, 2E, 2F, 2I, 2L (1F, 1G, 3B)
Broadcast: 4 bytes (mod-96) AA, DC, PD
Market Opens
SC code O ++++++++++>
Intermission
SC code I ++++++++++>
End Intermission
SC code F ++++++++++>
Pre-Open
SC code P ++++++++++>
Market Opens
SC code O ++++++++++>
Call Market
SC code A ++++++++++>
Runoff
SC code C ++++++++++>
Market close
SC code K ++++++++++>
Begin SU msg
SC Code G ++++++++++>
Send SU msg
End SU msg
SC Code J ++++++++++>
In case of
market halt:
Market Halt
SC code H ++++++++++>
Pre-Open
(If market is
halted HOSE will
resume market in
pre-open session)
SC Code P ++++++++++>
Market Open
If match
2E/2I ---------->
2E/2I ---------->
OS (not send ++++++++++>
in case ATC)
LS ++++++++++>
TP ++++++++++>
If can't
match or
something
left over
2C ---------->
2C ---------->
TP ++++++++++>
Market Open
If match
2E/2I ---------->
2E/2I ---------->
OS ++++++++++>
LS ++++++++++>
TP ++++++++++>
If can't
match or
something
left over
2C ---------->
2C
TP ++++++++++>
If new order
matched
2E/2I ---------->
2E/2I ---------->
LS ++++++++>
TP ++++++++>
If new order
not matched,
top 3
TP ++++++++>
Order not
matchable
2C ---------->
Matchable
2E/2I ---------->
2E/2I ---------->
LS ++++++++>
TP ++++++++>
If remains
2D ---------->
TP ++++++++>
If Order
matches
2E/2I ---------->
2E/2I ---------->
LS ++++++++>
TP ++++++++>
If can't
match or
something
left over
2C ---------->
If affect volume of
top 3 prices
TP ++++++++++>
If HOSE
disapprove
3D (code S) --------->
If HOSE
approve
3D (code A) --------->
DC +++++++++>
If contra
disapprove
<--------- 3B (code C)
3B(C) ---------> --------->
If contra
approve
<--------- 3B (code A)
2L ---------> --------->
PD +++++++++>
contra approve
Foreign bid,
but not enough
room
<--------- 3B (code A)
3B (code S) ---------> --------->
If contra
disapprove
<--------- 3D (code C)
3D(C) --------->
If contra approve
<--------- 3D (code A)
- If HOSE
disapprove
3D(S) ---------> --------->
- If HOSE approve
3D(A) ---------> --------->
DC +++++++++>
- If contra No further
approve but HOSE message will
not approve or be sent from
not disapprove system, it
will be put-
through deal
<--------- 1E
AA +++++++++>
5. Unit of Value
Unit in 1000
A 6 character numeric field in modulo-96 format that contains value
divides by 1,000.
Thus to find the actual value, this field must demodulo-96 first then
multiply with 1,000.
CTCI: None
Broadcast: IU, SU
Thus to find the actual value, this field must demodulo-96 first then
divide by 100.
CTCI: None
Broadcast: DC, IU, LE, OS, PD, PO, SI, SS, SU, TP
Thus to find the actual value, this field must divide by 1,000,000.
Before Pre- Open Break Pre- Open Call Run- Close Begin End Eod
CTCI Messages PreOpen Open Open off SU SU
System Code C P O I p O A C K G J
1C - Order Cancellation Yes Yes Yes Yes Yes
1D - Order Change Yes Yes Yes Yes Yes
1E - Advertisement Yes Yes Yes Yes
Announcement
1F - One Firm Put-Through Yes Yes Yes Yes
Deal
1G - Two Firm Put-Through Yes Yes Yes Yes
Deal
1I – New Order Yes Yes Yes Yes Yes
Before Pre- Open Break Pre- Open Call Run- Close Begin End Eod
Broadcast Messages PreOpen Open Open off SU SU
System Code C P O I P O A C K G J
Advertisement Announcement Yes Yes Yes Yes
(AA)
Deal Cancellation Notice (DC) Yes Yes Yes Yes
Index Update (IU) Yes Yes Yes Yes Yes Yes Yes
Last Sale(LS) Yes Yes Yes
Market Open Last Sale (OS) Yes Yes
Put Through Deal Notice (PD) Yes Yes Yes Yes
Projected Open (PO) Yes Yes Yes
System Control (SC) Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Sectoral Index (SI) Yes Yes Yes Yes Yes Yes Yes
Security Status Change (SS) Yes Yes Yes Yes Yes Yes Yes Yes Yes
Security Update (SU) Yes
Top Prices (TP) Yes Yes Yes Yes Yes Yes Yes
As a result, Message such as SC Code I will not be sent out from current HOSE’s system since there is no Break Session.
Modulo-96 numbers
Length Maximum Value
1 byte 95
2 bytes 9,215
3 bytes 884,735
4 bytes 84,934,655
5 bytes 8,153,726,975
6 bytes 782,757,789,695
Broker
Front system
A’, B’
Broadcast
Exchange
B system
DCTerm
B’
CTCI(A,A’,B,B’)
CTCI
PRS
PRS
Remark :
Revision
18-March 2008
19-March 2008
1. Add detail for Side usage in message “3C” (p38)
2. Add detail for Side description (p78)
7-May 2008
1. Change cancel PT flow from 1F->3C (p102)
2. Change order number description to fit 3 chars firm (p82)
9-July 2008
1. Change Type of Deal ID in Message 1F from Alphanumeric String to
Numeric String (p25)
15-July 2008
1. Add Error-code description for RN message(p75)
2. Modify Connection Termination, Protocol State Diagram (p12-p14)
3. Modify Auto-t message format (p8-p9)
05-Jan 2011
1. Change the length of Volume 1,2,3 in TP message from 3 byte to 4
byte (encoded)
2. Change the length of Lot Volume in LS messsage from 3 byte to 4
byte (encoded)
3. Halt / Resume Flag in SS message has these values: blank, “A”, “P”,
“H”