HKEx Gateway Documentation
Configuring Order and Fill Server Connections
Overview
Configure the Price and Order Server connections, as well as general TT Gateway behavior, in the hostinfo.cfg file. If you do not configure this file properly, the gateway will not function properly.
Configure hostinfo.cfg immediately after installing the HKEx Gateway, and again later when making changes to network connectivity. The hostinfo.cfg has the following sections:
- [Global]: Configures levels of logging and heartbeating for the HKEx Gateway.
- [PriceServer]: Configures the Price Server connection to the exchange.
- [MEMBER_<CUST1>]: Sets the exchange connectivity for the Order Server and Member ID for order routing.
- [MEMBER_<CUST1>_TTF]: Sets the user ID and password for the Fill Session.
- [MEMBER_<CUST1>_TTO_#]: Sets the user ID and password for each Order Session.
Note
When updating the hostinfo.cfg file, you must restart the HKEx Gateway in order for the changes to take effect. |
Warning
Prior to reconfiguring Login User IDs on the HKEx Gateway (e.g., removing [TTO_#] or [TTF] sections) customers must cancel all working orders at the Exchange. If an order was originally submitted through a [TTO_#] or [TTF] section that has since been commented out or removed, and the order is not canceled, it may be filtered out during initialization and ignored by the Gateway. |
Section: [MEMBER_<CUST1>]
Note
The [MEMBER_CUST1] section may optionally be used to set the connection IP and port for the TTF Order Sessions. Setting these parameters in the [TTF] section will override the default values that were specified in the [Global] section. |
You must configure the [MEMBER_<CUST1>] section of the hostinfo.cfg file to set the Exchange Member’s connectivity to the exchange host for order and fill sessions. When configuring multiple Exchange Members on the gateway for routing orders and fills, add a unique [MEMBER_<CUST1>] section per Member.
This section contains the following parameters:
Parameter |
Description |
---|---|
[Member_<CUST1>] |
Sets the section name. This section includes the Member’s user-defined trader ID, as well as the exchange-provided IP Address and port connections to the exchange for the Member’s order sessions. The gateway identifies order and fill connections for each member configured with the same <CUST1> variable in the section name. The “Member_” portion of the section name is required, but the <CUST1> parameter can be user-defined (e.g., [Member_BrokerB]) or used with the default value CUST1. This is a required parameter. |
Member |
Defines the Exchange Member routing orders through the gateway. This parameter is user-defined and must match the Member value (the “M” of the MGT gateway login) set in TT User Setup for the Exchange Member. Each Member parameter configured on the TT Gateway must be unique. This is a required parameter. |
Warning
The Order Server shuts down if the same Member parameter is configured more than once in hostinfo.cfg. |
|
AccessIP |
Identifies the IP address the Gateway uses to connect with the exchange. This credential is provided by the exchange. The IP Address configured in this section provides connectivity for the order [TTO_#] and fill [TTF] sessions configured for the Exchange Member. |
AccessPort |
Identifies the port the Gateway uses to connect with the exchange. This credential is provided by the exchange. The port configured in this section provides connectivity for the order [TTO_#] and fill [TTF] sessions configured for the Exchange Member. |
AccessIPSecondary |
Identifies the secondary IP address the Gateway uses to connect with the exchange if the primary IP address fails to connect. This credential is provided by the exchange. For 7.17 and later versions, this parameter is configured per member and is optional. |
AccessPortSecondary |
Identifies the secondary port the Gateway uses to connect with the exchange if the primary port fails to connect. This credential is provided by the exchange. For 7.17 and later versions, this parameter is configured per member and is optional. |
AccountCodeMapping |
Identifies the type of user account being used for order routing. The TT account types map to the account codes defined by the exchange. If set to “DefaultMapping”, the AccountCodeMapping parameter in the MEMBER_CUST# sections uses the values configured in the [AccountCodeMapping_DefaultMapping] section. The default value is DefaultMapping. |
AfterHourTrading |
Enables order routing for after hours trading (AHT). By default, after hours trading is not allowed by the TT Gateway.
Valid values are:
|
DisableGTC_GTDate |
Configures the Order Server to reject GTC and GTDate orders. Set this parameter to "1" to reject GTC and GTDate orders. By default, this parameter is hidden and the Order Server allows GTC and GTDate orders. |
AllowInactiveDelete |
Configures the Order Server to allow the prevent the deletion of AHT Inactivated orders, Valid values are "0", the member is blocked from deleting AHT Inactivated Orders; or "1", the member is permitted to delete AHT Inactivated Orders. |
SendAccountNumber |
Configures the Order Server to send the TT Account Number in 'ex_client_x' field. Valid values are 0 or 1. If this parameter is set to "1", then send the data populated in TT Account Number (FFT1) in ex_client_x. If this parameter is set to "0" or is not present, then continue to use the current account type mapping in hostinfo. The default value is "0". |
Section: [AccountCodeMapping_DefaultMapping]
Defines the default mapping of TT account types to exchange account codes defined by HKEx. The account type mapping is configured for each membership (i.e., [MEMBER_<CUST1>] section) in hostinfo.cfg.
HKEx defines the following default account codes:
TT Account Type | HKEx Account Code |
---|---|
A1=First Agent | H=House (Futures) |
A2=Second Agent | C=Client (Futures) |
A3=Third Agent | P1=House (Options) |
A4=Fourth Agent | A1=Client (Options) |
G1=First Give Up | G1=Give Up |
G2=Second Give Up | G2=Give Up |
U1=Unknown | U1=Give Up |
U2=Unknown | U2=Give Up |
M1=First Market Maker | M1=Market Maker |
Note
These are default account codes from HKEx. You can enter a user-defined account code value in the account code field in hostinfo (e.g., A1=MyAccountCode) and it will be sent to the exchange in the ex_client_s field. |
The default account code mappings configured in the [AccountCodeMapping_DefaultMapping] section are:
- A1=H
- A2=C
- A3=P1
- A4=A1
- G1=H
- G2=C
- U1=P1
- U2=A1
- M1=M1
Section: [MEMBER_<CUST1>_TTF]
You must configure the [MEMBER_<CUST1>_TTF] section of the hostinfo.cfg file to set the user ID and password for the Member to connect to the exchange via a fills session.
When using a single Order Session, the TT Gateway routes all order and fill data through the [TTF] session. In this scenario, only the [TTF] section of the hostinfo.cfg file is configured, and the Exchange Member’s [TTO_1] sections is commented-out.
Tip
By default, HKEx Gateways use the TTF Order Session to process both order and fill data. During heavy trading, this limits the performance of the gateway. To improve performance, TT recommends using multiple Order Sessions. Even adding one TTO Order Session shows a significant improvement over a single TTF Order Session and no TTO Order Sessions. Please contact the Exchange for information on obtaining additional Login User IDs. |
This section contains the following parameters:
Parameter |
Description |
---|---|
[Member_<CUST1>_TTF] |
Sets the section name. This section includes the Member’s exchange-provided User ID and password for connecting to the exchange for fills. The gateway identifies order and fill connections for each member configured with the same <CUST1> variable in the section name. The “Member_” portion of the section name is required, but the <CUST1> parameter can be user-defined (e.g., [Member_BrokerB_TTF]) or used with the default value (CUST1). This is a required parameter. |
UserId |
Sets the user ID for orders and fills. Enter the user ID provided by the exchange. |
UserPassword |
Sets the password for the Order Server connection. Use the password provided by the exchange. |
AccessIP |
Identifies the IP address the Gateway uses to connect with the exchange. This is optional if you want to override the IP Address configured in the [Member_<CUST1>] section. |
AccessPort |
Identifies the port the Gateway uses to connect with the exchange. This is optional if you want to override the port configured in the [Member_<CUST1>] section. |
AccessIPSecondary |
Identifies the secondary IP address the Gateway uses to connect with the exchange if the primary IP address fails to connect. This is optional if you want to override the secondary IP Address configured in the [Member_<CUST1>] section. |
AccessPortSecondary |
Identifies the secondary port the Gateway uses to connect with the exchange if the primary port fails to connect. This is optional if you want to override the secondary port configured in the [Member_<CUST1>] section. |
Section: [MEMBER_<CUST1>_TTO_#]
The [TTO_#] section sets the user IDs and passwords for each Member’s order sessions. The gateway selects an order session using a round-robin algorithm based on messaging volume. For example, if the transaction per second (TPS) is lower on TTO_2 than it is on TTO_1, the gateway will select TTO_1 to route the order.
If you use more than two Order Session IDs, you must add and configure [MEMBER_<CUST1>_TTO_#] sections for each additional session. OM Gateways 7.17 and later versions can be configured with as many as 200 [TTO_#] sessions with 25 sessions and 1 fill session [*TTF_#] per Member.
Warning
Prior to reconfiguring Login User IDs on the Gateway (e.g., removing or adding [MEMBER_<CUST1>_TTO_#]sections) customers must cancel all working orders at the Exchange. If an order was originally submitted through a [MEMBER_<CUST1>_TTO_#] section that has since been commented out or removed, and the order is not canceled, it may be filtered out during initialization and ignored by the Gateway. |
This section contains the following parameters:
Parameter |
Description |
---|---|
[MEMBER_<CUST1>_TTO_#] |
Sets the section name. This section includes the Member’s exchange-provided User ID and password for connecting to the exchange for fills. The gateway identifies order and fill connections for each member configured with the same <CUST1> variable in the section name. The “Member_” portion of the section name is required, but the <CUST1> parameter can be user-defined (e.g., Member_BrokerB_TTO_1]) or used with the default value (CUST1). This is a required parameter. In the first [MEMBER_<CUST1>_TTO_#] section, # is 1. For every [*TTO_#] section after the first, you must increment this number by one. |
UserId |
This value is assigned by the exchange and must be unique across each HKEx Gateway. |
UserPassword |
Sets the password for this session. Enter the password provided by the exchange. |
AccessIP |
Identifies the IP address the Gateway uses to connect with the exchange. This is optional if you want to override the IP Address configured in the [Member_<CUST1>] section. |
AccessPort |
Identifies the port the Gateway uses to connect with the exchange. This is optional if you want to override the port configured in the [Member_<CUST1>] section. |
AccessIPSecondary |
Identifies the secondary IP address the Gateway uses to connect with the exchange if the primary IP address fails to connect. This is optional if you want to override the secondary IP Address configured in the [Member_<CUST1>] section. |
AccessPortSecondary |
Identifies the secondary port the Gateway uses to connect with the exchange if the primary port fails to connect. This is optional if you want to override the secondary port configured in the [Member_<CUST1>] section. |
Example hostinfo.cfg:
Example |
---|
[GLOBAL] # Configure any global parameters here. ## PRICE SERVER CONFIGURATION ## [PriceServer] ExchangeIP=10.37.253.2 ExchangePort=12345 ## ORDER SERVER CONFIGURATION ## [MEMBER_CUST1] Member=MBR1 AccessIP=10.1.2.3 AccessPort=1234 AccessIPSecondary=10.2.3.4 AccessPortSecondary=2345 AccountCodeMapping=DefaultMapping [MEMBER_CUST1_TTF] UserID=TTORHL82 UserPassword=12345678 [MEMBER_CUST1_TTO_1] UserID=TTORHL82 UserPassword=12345678 [MEMBER_CUST1_TTO_2] UserId=TTORHL83 UserPassword=12345678 [AccountCodeMapping_DefaultMapping] A1=H A2=C A3=P1 A4=A1 G1=H G2=C U1=P1 U2=A1 M1=M1 # [MEMBER_CUST2] # Member=MBR2 # [MEMBER_CUST2_TTF] # UserId=xxxx # UserPassword=xxxx # AccessIP=x.x.x.x # AccessPort=xxxxx # AccessIPSecondary=x.x.x.x # AccessPortSecondary=xxxxx # [MEMBER_CUST2_TTO_1] # UserId=xxxx # UserPassword=xxxx # AccessIP=x.x.x.x# AccessPort=xxxxx# AccessIPSecondary=x.x.x.x# AccessPortSecondary=xxxxx# [MEMBER_CUST2_TTO_2]# UserId=xxxx# UserPassword=xxxx# AccessIP=x.x.x.x# AccessPort=xxxxx# AccessIPSecondary=x.x.x.x# AccessPortSecondary=xxxxx |