Note
At this time the T4 API is in Microsoft .Net Framework 4.7. You should ensure that you have the latest Service Packs and hotfixes for Framework installed.
This topic contains the following sections:
This document outlines how to use the T4 API 4.7. The API consists of a set of objects in a Microsoft .Net Framework DLL and is included within the 4.7+ version Simulator client install available here.
To develop to the API you need a development tool that fully supports Microsoft .Net Framework 4.7, such as Microsoft Visual Studio .Net 2017. To assist development we have a simulator system that provides market depth and execution 24x5, regardless of real market hours. From the API’s perspective the simulator works exactly the same as the live system.
In the early stages of development we ask that developers make use of the license provided in our examples. This allows access to some Dummy markets so that you can subscribe for quotes and submit orders. To access real markets, such as the CME, you have to request a Simulation license code.
To request production live and/or Simulator license codes please provide the following information to YOUR CLEARING FIRM. Your clearing firm is then required to provide support@ctsfutures.com with their informal approval and the details you have provided.
Live Firm | The live firm used as part of user authentication. |
Live Users | All Live users that require access to this application. Configuration of Live users will be completed by your broker or FCM. CTS is not permitted to configure Live users. |
Sim Firm | The Simulation firm used as part of user authentication. |
Sim Users | All Simulation users that require access to this application. |
Application | Name of your application. This needs to be unique across our system so it should be prefixed with your company initials or similar. Please do not include "T4" or "CTS" or "Cunningham" in your application name. |
Developer | Name of the developer or person responsible for the application. |
Email address for the developer | |
Phone | Phone number for the developer |
You will then be provided with a license code that your application will need to use every time it logs in. Please note that the license code will be different for the Live and Simulator systems.
We strongly encourage developers to create a single application to satisfy all of their needs. Same as our front-end sits on a single instance of the API and yet offers many different types of functionality. Running multiple applications increases bandwidth usage and overall overhead on our system.
Enabling a T4 application license and having it assigned to a user:
A user must have their firm T4 administrator add a T4 license (by name) to their T4 userid.
User asks their firm to have access to "XY_GenericApp".
If the firm has "XY_GenericApp" in their list the T4 admin assigns it to the T4 user and the user is ready to login.
If the firm does not have "XY_GenericApp" in their list they (the firm administrator) must make an informal request via email to support@ctsfutures.com along the lines of: "Hey guys can you please add XY_GenericApp to our firm so that I can assign it to a user." We will add the license and notify the firm.
The firm will then assign "XY_GenericApp" to the T4 user and the end user is notified by the firm T4 administrator. Generally not by CTS unless requested by the firm.
There are several example projects that are installed with the Simulator frontend. All the example projects were created in Visual Studio 2010. You can access these examples from the C:\users\"your windows user"\documents\ T4 API Examples shortcut.
T4Example | This is a basic example showing login, account and market subscription and order submission. |
T4Example2vb | More complicated example in VB. |
T4Example2cs | More complicated example in C#. |
T4Example3 | Shows a simple market picker and market subscription. |
T4Examplecpp | How to access the API from c++. |
T4Chart | This shows how you can get historical chart data. |
T4ChartDataExmaple1 | This shows how you can get historical chart data using the ChartDataAPI. |
T4MultiUserExample | This shows how you can login additional users within a session for order routing. |
T4Service | This shows how to use the API from within a Windows Service. |
Our API Examples run out of the box because we ensure the correct dependency files are referenced by the example project.
Install the latest version of Sim. The CTS T4 installer determines whether the user’s system is 32 or 64 bit. One could choose to install live but then the post build events would need to be updated as well to point to the appropriate install folder. Keep in mind these build events are not required. As a developer you can do without so long as you manually distribute the appropriate dependencies. The most important thing to keep in mind if using the post build events is that they point to a valid directory.
Set your project Target CPU to AnyCPU so you don’t run into issues where they are compiling 32bit but the dependencies they are copying are 64bit.
copy "C:\Program Files\CTS\T4ClientSim\bin\System.Data.SQLite.40.DLL" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\zlib1.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\Newtonsoft.Json.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\T4APICore.47.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\System.Data.SQLite.40.DLL" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\zlib1.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\Newtonsoft.Json.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\T4Connection.47.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\T4Message.47.dll" "$(TargetDir)"
copy "C:\Program Files\CTS\T4ClientSim\bin\T4TraceListener.47.dll" "$(TargetDir)"
The T4 API requires the following files to be in the same folder as your executable:
Newtonsoft.Json.dll
Zlib1.dll - Note: There are different versions of this file installed depending on whether your system is x64 or x86.
System.Data.SQLite.40.DLL - Note: There are different versions of this file installed depending on whether your system is x64 or x86.
T4APICore.47.dll
T4API.47.dll
T4Definitions.47.dll
T4API.47.dll
T4Connection.47.dll
T4Message.47.dll
T4TraceListener.47.dll
If T4 is being run beind a customer firewall then the following address ranges will need to be opened:
Internap - EQ-CER Range: 74.201.6.0 /24 Mask: 255.255.255.0
CenturyLink - EQ-CER Range: 69.44.110.0 /24 Mask: 255.255.255.0
Our applications use port 80 and 443 on any of those IP’s. From a domain name perspective then you need *.t4login.com, *.sim.t4login.com and www.ctsfutures.com open.
If your proxy requires authentication then you will need to allow T4 to bypass it as the Microsoft .Net Framework we use doesn’t support authenticating proxy servers. If your proxy doesn’t require authentication then T4 should work fine, but if it doesn’t then the simplest solution would be to bypass the proxy if that is possible.