Data and Trading Communications (DTC) Protocol Server

Introduction

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. Although historical data only supports Binary Encoding at this time.

Server Usage

Follow the instructions below to use the DTC Protocol server:

  1. Select Global Settings >> Data/Trade Service Settings in Sierra Chart.
  2. Press the SC Server Settings button.
  3. Enable DTC Protocol Server >> Enable DTC Protocol Server .
  4. In the Listening Port box, specify the port number for the server to listen on or keep the default. This cannot be 0.
  5. 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).
  6. Press OK to save the settings and close the settings window.
  7. Establish a TCP/IP network connection to 127.0.0.1 using the specified port number.
  8. Follow the DTC Protocol Connection and Logon Sequence.
  9. 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).
  10. Sierra Chart always uses the latest DTC Protocol version.
  11. For detailed information to work with the DTC Protocol and the supported messages and fields, refer to the DTC Message and Procedures page.
  12. The following market data messages are used by the Sierra Chart DTC Protocol Server and no others.

Special Notes

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.

Historical Price Data Server

In version 1372 and higher of Sierra Chart, there is now a DTC compatible Historical Price Data Server.

Follow the instructions below to use this server.

  1. Update to version 1372 or higher of Sierra Chart.
  2. Select Global Settings >> Data/Trade Service Settings.
  3. Press the SC Server Settings button.
  4. Enable the DTC Protocol Server >> Enable DTC Protocol Server option.
  5. Set the Historical Data Port number. The default is 11098.
  6. Press OK.
  7. Follow the Historical Price Data procedures section for using DTC messages with the server.
  8. 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.
  9. Only the DTC Binary Encoding is currently supported.
  10. 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 this setting, 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.
  11. 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

The DTC Protocol Server in Sierra Chart can be used by another instance of Sierra Chart either on the same computer or across a network. This DTC Server supports both trading and market data.

  1. Make sure you are running a current version of Sierra Chart. Update Sierra Chart by selecting Help >> Download Current Version.
  2. Using the DTC Protocol server to share market data and to trade in other instances of Sierra Chart whether on the same computer or different computers, completely replaces the method of sharing chart and market data documented on the Multiple Services page.
  3. An easy way to start another instance of Sierra Chart on the same computer which will connect to the DTC Server for market data and trading, is to select File >> New Instance in an existing running instance of Sierra Chart. In this particular case skip all the way to step number 19 below.

    This step only applies when using another instance of Sierra Chart on the same computer. Otherwise, skip to the next step.

    To automatically start new instances of Sierra Chart on startup of the main instance, the instance numbers can be specified as a comma separated list in Global Settings >> General Settings >> Instances to Run on Startup. For example, you can enter a 2 in that edit box to automatically start a second instance. Or enter 2, 3 to start a second and third instance automatically.

    When using File >> New Instance, a new instance is automatically updated to the same version as the main instance of Sierra Chart.

    Each instance of Sierra Chart maintains its own copy of global settings, Chartbooks and chart data files. The first time a new instance is created, it receives a copy of the global settings and Chartbooks from the main instance.
  4. In the instance of Sierra Chart which will be used as the server, select Global Settings >> Data/Trade Service Settings.
  5. Press the SC Server Settings button.
  6. Enable the DTC Protocol Server >> Enable DTC Protocol Server option.
  7. In the Listening Port box, specify the port number for the server to listen on or keep the default. This cannot be 0.
  8. Set the Historical Data Port or keep the default. This cannot be 0 unless you do not want to use the historical data server.
  9. Unless you require the Auto Send Security Definition for New Symbols option, make sure this option is disabled. In standard cases this should be disabled. Otherwise, the Sierra Chart client instance connecting to the DTC Server, will request real-time data and download historical data for all symbols being tracked in the Server instance.
  10. Enable the Allow Trading option if you want to perform trading in other instances of Sierra Chart.
  11. Press OK to save the settings and close the SC Server Settings window.
  12. In the instance of Sierra Chart which will be used as the client, this can be on the same or different computers, select Global Settings >> Data/Trade Service Settings.
  13. Set the Service to DTC Service (sub instance).
  14. Set the Server Address to the IP Address of the computer running the instance of Sierra Chart where the DTC Server is enabled on. In the case of when connecting to the DTC server in another copy of Sierra Chart on the same computer, use this IP address: 127.0.0.1. If you are connecting across the Internet the IP address needs to be the public IP address for the computer. An easy way to find this is to run an Internet search for "what is my IP address".
  15. Set the Server Port to the Port used by the DTC Server you set up above. This is going to be what is set in Global Settings >> Data/Trade Service Settings >> SC Server Settings >> DTC Protocol Server >> Listening Port in the instance of Sierra Chart using the DTC server. Refer to the image below.
  16. Set Use Sierra Chart Instance Username and Password to Yes/True when connecting to other instances of Sierra Chart on other computers that are logged in with your own Sierra Chart Username (Account Name) and Password.
  17. It is recommended to set Use TLS (Transport Layer Security) Yes/True when connecting across the Internet to another copy of Sierra Chart and you will be using that connection for trading. This enables encryption. However, for the connection to succeed, Global Settings >> Data/Trade Service Settings >> SC Server Settings >> DTC Protocol Server >> Require TLS must be enabled in the instance of Sierra Chart using the DTC Server.
  18. Press OK.
  19. To open a chart which will be fed by the DTC Server from the main instance of Sierra Chart, select File >> Find Symbol in the new instance of Sierra Chart.
  20. The Find Symbol list will initially be empty because the Symbol Settings have to be requested. Wait a moment for them to be received and then the list will fill in. If this does not occur within about 5 to 20 seconds, then follow the procedure to perform a Full Reset of the Symbol Settings to get them. It is necessary to have the proper Symbol Settings in an instance of Sierra Chart which is connected to the DTC Server of another instance.

Historical Data and Missing Historical Data

All historical Intraday and Daily data for a Symbol in an instance of Sierra Chart connected to the DTC Server of another instance, is downloaded from the existing Intraday or Daily chart data file in the DTC Server instance if the file exists.

If the file exists, but it is not up to date with the current data, then the current data will be downloaded into it first before the data is served to other instances of Sierra Chart.

If a chart data file does not exist in the DTC Server instance, then the data will be automatically downloaded for that Symbol and chart data type from the connected Data or Trading service the DTC Server instance is set to use.

If there is any missing data in the instance of Sierra Chart connected to the DTC Server, then go to the DTC Server instance and open the same type of chart (Historical or Intraday) for the same Symbol and correct any missing data issues there first. Refer to the following two sections to solve any missing data issues.

Simulated Trading in a Sub Instance

Simulated trading can be performed two different ways in a sub instance of Sierra Chart.

First Method

Use Trade Simulation Mode by enabling Trade >> Trade Simulation Mode On. In this case, all of the trading activity is contained within the sub instance where the trading is performed.

Second Method

  1. Set the main instance of Sierra Chart that the sub instance is connected to, to use Trade Simulation Mode.
  2. In the sub instance, disable Trade >> Trade Simulation Mode On.
  3. From the Chart or Trade DOM you will be trading from in the sub instance, select one of the Simulation (Sim#) accounts. Refer to Selecting Trade Account.
  4. All trading from the sub instance will then be simulated and be processed in the main instance. Logging of the simulated trading will be in both instances.

Using the Correct Trade Account

When trading in a sub instance of Sierra Chart and Trade >> Trade Simulation Mode On is disabled, it is necessary to use the Trade Account in the sub instance which corresponds to the Trade >> Trade Simulation Mode On setting in the main instance of Sierra Chart.

When Trade >> Trade Simulation Mode On is enabled in the main instance, then you can only use simulated trading accounts in the sub instance (Example: Sim1). Refer to Selecting Trade Account.

When Trade >> Trade Simulation Mode On is disabled in the main instance, then you can only use non-simulated trading accounts in the sub instance. Refer to Selecting Trade Account.

If the incorrect Trade Account is being used in the sub instance, you will see a message like this in Trade >> Trade Service Log in the sub instance after submitting an order:

Rithmic Trading order update (Order reject). Info: Simulated Trade Account (Sim1) cannot be used when Trade Simulation Mode is disabled. Internal Order ID: #. Service Order ID: (none). Symbol: (symbol)

Resolving DTC Protocol Server Port Number Conflicts

Normally only one instance of Sierra Chart that you are running on the same computer should be set to be a DTC Server and have the server enabled.

If other instances of Sierra Chart which are running your computer system at the same time also have the DTC Server enabled, you need to make sure there are not port number conflicts. In other words, they need to be using different port numbers.

Follow through the below steps to resolve port number conflicts.

  1. Go to the main instance of Sierra Chart and select Global Settings >> Data/Trade Service Settings >> SC Server Settings.
  2. Make sure the Enable DTC Protocol Server option is enabled and make a note of the Listening Port and Historical Data Port numbers.
  3. Press OK
  4. PressOK.
  5. Go to the next instance of Sierra Chart on your system and select Global Settings >> Data/Trade Service Settings >> SC Server Settings.
  6. Either uncheck the Enable DTC Protocol Server option or set the Listening Port and Historical Data Port numbers to different port numbers than what are currently used in the main instance of Sierra Chart. You can use any port numbers. They should be in the range of 10000 through 60000.
  7. In the case of an instance of Sierra Chart started with File >> New Instance and where the Global Settings >> Data/Trade Service Settings >> Service in that instance is set to DTC - Sub Instance, then you must uncheck the Enable DTC Protocol Server option.
  8. Press OK
  9. PressOK.
  10. Repeat steps 5 through 9 for other instances of Sierra Chart on your system.

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:

Windows error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

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:

DTC Protocol Server | Rejecting connection from (IP address)

Restrictions

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 Wednesday, 14th September, 2016.