Data and Trading Communications (DTC) Protocol Server
- Server Usage
- Special Notes
- Historical Price Data Server
- US Bond Futures Pricing
- Using DTC Server for Data and Trading in Another Sierra Chart Instance (New Page)
- Troubleshooting Connection Problems to DTC Server
Sierra Chart provides a full DTC Protocol, server for market data and for trading. This is a TCP/IP socket based server.
Multiple client connections are supported. The connection can be from any IP address and this is controllable within Sierra Chart.
With the DTC Protocol Server, all trading related messages are fully supported. Both non-simulated and simulated trading is supported when using the DTC Protocol Server. For proper support for both of these, make sure you are running a current version of Sierra Chart.
All of the encoding methods supported by the DTC Protocol are supported by the DTC Protocol Server in Sierra Chart.
The DTC Protocol historical data server port now supports all DTC Encodings as of version 1558.
Follow the instructions below to use the DTC Protocol server:
- Select Global Settings >> Data/Trade Service Settings in Sierra Chart.
- Press the SC Server Settings button.
- Enable DTC Protocol Server >> Enable DTC Protocol Server.
- In the Listening Port box, specify the port number for the server to listen on or keep the default. This cannot be 0.
- Enable DTC Protocol Server >> Allow Trading for the trading related DTC Protocol messages to be supported. Otherwise, they will not be by the DTC Server in Sierra Chart.
- To have Sierra Chart automatically send a SECURITY_DEFINITION_RESPONSE message when Sierra Chart begins to track a symbol, then enable the Auto Send Security Definition for New Symbols option. In this particular case, the RequestID field will be set to 110000000 (This is not binary, but base 10).
- Press OK to save the settings and close the settings window.
- Establish a TCP/IP network connection to 127.0.0.1 using the specified port number.
- Follow the DTC Protocol Connection and Logon Sequence.
- The Username and Password in the LOGON_REQUEST message should be blank unless Global Settings >> Data/Trade Service Settings >> SC Server Settings >> DTC Protocol Server >> Require Authentication is enabled. A Username and Password will also be required when Global Settings >> Data/Trade Service Settings >> SC Server Settings >> Allowed Incoming IPs is set to Any IP.
These are the only fields which are used in the LOGON_REQUEST message: Username, Password, HeartbeatIntervalInSeconds, ClientName, TradeMode, ProtocolVersion (automatically set).
- Sierra Chart always uses the latest DTC Protocol version.
- For detailed information to work with the DTC Protocol and the supported messages and fields, refer to the DTC Message and Procedures page.
- The following market data messages are used by the Sierra Chart DTC Protocol Server and no others.
When modifying a Stop-Limit order using CANCEL_REPLACE_ORDER or CANCEL_REPLACE_ORDER_INT, then only Price1 can be modified. Price2 will be set to a price to maintain the same price difference that Price2 had to Price1 before the order modification.
The SYMBOLS_FOR_EXCHANGE_REQUEST messages supported by the DTC Server. However, the exchange field is ignored in Sierra Chart returns security definitions for the known symbols for the current Data/Trade service that Sierra Chart is currently set to work with.
Historical Price Data Server
The DTC Protocol server in Sierra Chart has a full DTC compatible Historical Price Data Server.
Follow the instructions below to use this server.
- Select Global Settings >> Data/Trade Service Settings.
- Press the SC Server Settings button.
- Enable the DTC Protocol Server >> Enable DTC Protocol Server option.
- Set the Historical Data Port number. The default is 11098.
- Press OK.
- Follow the Historical Price Data procedures section for using DTC messages with the server.
- This DTC Historical Price Data server only accepts one request per connection. You will notice that s_LogonResponse::OneHistoricalPriceDataRequestPerConnection is set to 1. After the first request is served, another one will not be accepted and the network socket connection will eventually get closed.
- All of the encodings are supported. It is not recommended to use JSON encoding for large amounts of historical Intraday data.
- Historical price data is served from existing Historical Daily and Intraday data files. If the file is not up to date or does not exist, the data will first be downloaded and then after served back. A connection to the data feed will be made in Sierra Chart if it is necessary, to download the missing data. Therefore, only the data that is present in the file can be served.
To increase the amount of Intraday data available for a particular symbol, the Global Settings >> Data/Trade Service Settings >> Maximum Historical Intraday Days to Download >> Non-Tick Data/1 Tick Data settings need to be increased. After increasing either of these settings, it is necessary to open an Intraday chart for the symbol in Sierra Chart and then re-download the data with Edit >> Delete All Data and Download.
- The HISTORICAL_PRICE_DATA_REQUEST::EndDateTime field is ignored unless HISTORICAL_PRICE_DATA_REQUEST::MaxDaysToReturn is set to a value greater than zero. the
The historical price data server implemented by Sierra Chart is intended to always to return data up to the very latest data available. Therefore, as a general rule you should only specify HISTORICAL_PRICE_DATA_REQUEST::StartDateTime or leave it at 0 to get all available data. It is never recommended to use the EndDateTime or MaxDaysToReturn fields in the request.
US Bond Futures Pricing
The Market Data Messages that Sierra Chart sends for market data, use 4-byte floats for numbers.
This is sufficient accuracy for all symbols except for US bond market symbols.
In this particular case, the precision is sufficient enough to convert to the actual value. This can be done by dividing the given float value by the MinPriceIncrement from the SECURITY_DEFINITION_RESPONSE message for the symbol, rounding that result to the nearest integer and multiplying that integer by MinPriceIncrement.
Using DTC Server for Data and Trading in Another Sierra Chart Instance
Refer to the Using DTC Server for Data and Trading in Another Sierra Chart Instance documentation.
Troubleshooting Connection Problems to DTC Server
When using an instance of Sierra Chart acting as a server by having the DTC Protocol Server enabled, you are connecting to it from a different computer or a different operating system instance on the same physical machine, and you encounter a problem connecting, first review the instructions in the Using DTC Server for Data and Trading in Another Sierra Chart Instance section.
Make sure the DTC server in the server instance of Sierra Chart is enabled. Check that you have correctly specified the correct IP address and Port number in the client instance of Sierra Chart which you are connecting from.
If there still is a connection problem connecting from the client instance of Sierra Chart to the server instance of Sierra Chart, then most likely this is going to be the result of the connection getting blocked somewhere between the two instances of Sierra Chart.
The specific reason for the connection failure, is going to be shown in the Window >> Message Log of the client instance. The operating system network socket connection error is given. You will need to conduct your own research on the meaning of that error.
The typical reason for the connection failure are firewalls and Network Address Translation (NAT) devices.
The first step is to disable the operating system (Windows) firewall to see if the connection then succeeds. If that resolves the problem, then add a rule to the Windows firewall to allow incoming connections to the Sierra Chart program. Otherwise, the resolution of a problem like this is not within the scope of Sierra Chart support.
In the case when the following error is encountered in the Window >> Message Log after about 20 seconds when connecting to the DTC server:
Then this is an indication that a firewall or NAT is either blocking or not routing the connection. You may have to use port forwarding through your NAT device.
If the Global Settings >> Data/Trade Service Settings >> SC Server Settings >> DTC Protocol Server >> Allowed Incoming IPs setting is blocking the connection, then you will know this is happening because you will see a message like the following in the Window >> Message Log of the server instance of Sierra Chart:
Due to legal requirements imposed by the TeleTrader Data service due to exchange requirements, the DTC Protocol Server will provide no market data when the TeleTrader Data service is the primary connected Data Service in Sierra Chart unless it is Sierra Chart itself connecting to the DTC Server.
*Last modified Friday, 08th September, 2017.