← Back to X_TRADER® Help Library

HKEx Gateway Documentation



You must configure and uncomment the Key Server section in the ttchron.ini file. If you choose to run a Key Server on this server, remove the hash symbols (#) from the following lines (including the section header): schedule=B@04:30-04:00/7


You can only run a maximum of one Key Server per market; if another HKEx Gateway is running a Key Server in this TT environment, do not uncomment the Key Server section.


You must delete all other TT Gateway sections in the ttclean.ini file:

Trader IDs

You must add trader IDs to the TT User Setup Server (via TT User Setup located on a different machine within the TT environment) or to WUAS/Active Directory.

Be sure to follow the proper syntax for trader IDs as indicated in this document and configure each trader ID in the Exchange-Flavorhostinfo.cfg file.


Reboot the server.

Start TT Services

After reboot, open the Control Panel and select Administrative Tools. Within the Administrative Tools menu, select Services. Double-click on the Start Guardian icon from the desktop.

Verify that the IP address that this TT Gateway has been licensed for appears in the Applications On section of Guardian. Start the GuardServer service and ensure GuardServer shows up under the correct HKEx Gateway Exchange-Flavor.


If the GuardServer shows up under the “TT GuardServers starting up” Exchange, it has not found a valid license.

Start TTChron

Start the TTChron Service in order to start all necessary TT Services, (assuming you are starting the HKEx Gateway during normal trading hours).

Execute Test Trade

Once the HKEx Gateway is completely green in Guardian, log into an X_TRADER® machine and enter a test trade. Remember that necessary risk parameters must be set up in order to successfully place a trade.

Connectivity Test

The TT Gateway installation package distributed by TT includes an Exchange-provided login test tool utility: apitstlogin.exe. This utility installs in <root drive>:ttExchange-Flavor. You must run this executable from a command prompt.

To test API login:

  1. On the Start menu, point to Programs, and then click Command Prompt.
  2. Type: apitstlogin.exe UserName Password Gateway Port
    • UserName is the trader’s userID.
    • Password is the trader’s password to connect to HKEx.
    • Gateway is the IP address of the HKEx Gateway.
    • Port is the port number of the HKEx Gateway.

    Example API Login Test

    apitstlogin.exe TTO31P23 4cdt3 5001

Failed Connectivity Test

If the connectivity test fails, you will receive the following message: Error (-2012) Reason : system error occured on ‘connect’

If you receive this message, check the command line for incorrect typing. Alternatively, the Exchange host may be down or off-line.


Contact the Exchange if you are unable to perform a successful connectivity test.

Successful Connectivity Test

If the connectivity test is a success, you will receive the following response:

Example Successful Connectivity Test Response

C:ttHKEx> apitstlogin.exe TTO31A23 4cdt3 5001

Logging in user.. Success

Getting user info.. Success

User Info:



Country ID: SG

Getting facility id EP0.. Success

EP0 Facility 720

Logging out user..

Closing API session..

Once your connectivity test is successful, the UserName, Password, Gateway, and Port may be used in the Exchange-Flavorhostinfo.cfg as TTO, TTP, or TTF settings.