Support Board
Date/Time: Wed, 30 Apr 2025 13:46:44 +0000
[Programming Help] - Orders Not Being Processed via DTC
View Count: 285
[2025-04-02 18:34:21] |
User483520 - Posts: 6 |
Hello, I am developing a C++ DTC client using your DTC Protocol (version 8) to submit orders to Sierra Chart in simulation mode. While the connection and logon processes work correctly, my orders (both a standard market order and a pending stop market order—with a trigger price of 20.000 for MNQ) are not being processed by the server. I have implemented extensive logging and debugging in my client, yet the only messages I receive are a MARKET_DATA_FEED_STATUS (message type 100) and a LOGOFF (message type 5). No ORDER_UPDATE messages (message type 301) or any error/alert messages (such as types 700, 701, or 702) are received. Below is a summary of my testing and configuration: Connection and Logon: My client successfully connects to the DTC server (IP: 127.0.0.1, Port: 11099) and sends a LOGON_REQUEST with ProtocolVersion = 8. I receive a LOGON_RESPONSE with a result code of 1 (success) and the expected server name. Logon round-trip latency is minimal (approximately 1–5 ms). Order Submissions: I have implemented sending a standard market order using SUBMIT_NEW_SINGLE_ORDER (message type 208). For this order, I set Price1 and Price2 to DBL_MAX (to indicate a market order) and generate a unique ClientOrderID using a high‑resolution timestamp. I have also implemented sending a pending stop market order (using OrderType = 3) for a BUY order with a trigger price of 20.000. Both orders include all required fields: symbol (“MNQM25_FUT_CME”), exchange (“CME”), trade account (“username”), OpenOrClose flag set to TRADE_OPEN, etc. My client logs confirm that the orders are sent successfully (e.g., “Market order submitted: BUY 1.000000 contracts” and “Stop market order submitted…”). Receiver Logging: The receiver thread logs all incoming messages. Aside from a MARKET_DATA_FEED_STATUS message (type 100) and a LOGOFF message (type 5), no ORDER_UPDATE messages (type 301) or any error/alert messages (types 700, 701, 702) are received. I have also added raw hexadecimal logging for unknown message types, but nothing indicates a server-side error or rejection. Given these details, I kindly request your assistance with the following: Server Configuration: Are there any specific server-side settings (such as trading session parameters, instrument configuration, or trade account restrictions) that might cause orders to be silently ignored even when logon succeeds? Order Processing Requirements: Is there any additional requirement—especially in simulation mode—for orders to be accepted and processed? Debugging Options: Are there any additional debug or verbose logging options on the DTC server that I can enable to obtain further insight into why my orders are not being processed? Protocol or Feature Limitations: Since market data subscription is not possible via DTC with Sierra Chart, is there an alternative method to ensure the security definition for the instrument is loaded so that order submissions are accepted? I appreciate any guidance or recommendations you can provide to resolve this issue. I have verified that my client’s message structures and fields adhere to the official DTC protocol documentation. Thanks you for your assistance |
[2025-04-03 14:38:01] |
Sierra_Chart Engineering - Posts: 19383 |
You definitely should be receiving an ORDER_UPDATE message, immediately after you submit an order. Do you see the Order you submitted listed in Trade >> Trade Orders Window? If not, then it is not getting processed. Check the Window >> Message Log in Sierra Chart and see if there is any error message displayed there. Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2025-04-03 14:43:19
|
[2025-04-03 17:07:54] |
User483520 - Posts: 6 |
Nope, nothing happening in neither Trade Orders or Trade Activity Log. Results are the same for both TRADE_MODE_LIVE and TRADE_MODE_SIMULATED. Sierra Chart Server Settings is set to standard ports. Allow Trading = Yes. Here's the Message Log for a test I ran just now. At 12:15:00:500 a BUY STOP MARKET order was sent by client. I suppose I need to get out of "relay server mode"? How does one do that? Or is it a security definition issue? In Server Settings Auto Send is set to Yes, I also have an intraday cchart open and symbol added to Quote Board. Message Log : 2025-04-03 12:14:36.991 | Unset | DTC Protocol server | Incoming connection from 127.0.0.1. 2025-04-03 12:14:36.991 | Network | DTC client #28. 127.0.0.1 (3) | Creating socket. 2025-04-03 12:14:36.991 | Network | DTC client #28. 127.0.0.1 (3) | New receive buffer size: 262144 2025-04-03 12:14:36.991 | Unset | DTC client #28. 127.0.0.1 | Requested heartbeat interval: 1 2025-04-03 12:14:36.991 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | Received logon request. 2025-04-03 12:14:36.991 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | Using relay server mode. Using subscriptions. 2025-04-03 12:14:36.991 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | Sent successful Logon response message to client. Username: HIDDEN. Result text: Connected to SC DTC Protocol server. Service=sc_futures_direct.dtc.trading|SymbolSettings=sc_futures_direct.dtc.trading 2025-04-03 12:14:36.991 | Network | DTC client #28. 127.0.0.1 (3) | Allocated send buffers: 31 of 131072 bytes. 2025-04-03 12:14:39.997 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | Sending all symbols to relay client. 2025-04-03 12:14:39.997 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | Not sending MNQM25_FUT_CME security definition to the client. Market data not allowed to be relayed for symbol. 2025-04-03 12:15:06.501 | Unset | DTC client #28. �������������������������������. 127.0.0.1 | OnDelayedDisconnect 2025-04-03 12:15:06.501 | Network | DTC client #28. 127.0.0.1 (3) | CloseSocket call. 2025-04-03 12:15:06.501 | Network | DTC client #28. 127.0.0.1 (3) | Shutdown started. Waiting for graceful close. 2025-04-03 12:15:07.494 | Unset | Deleting individual DTC server: DTC client #28. �������������������������������. 127.0.0.1 2025-04-03 12:15:07.495 | Unset | DTC server: DTC client #28. �������������������������������. 127.0.0.1 successfully deleted. Here's the output from my client for that same test. It includes some debugging: [Thu Apr 3 12:14:36 2025] Trading client started. [Thu Apr 3 12:14:36 2025] Connected to DTC server at 127.0.0.1:11099 [Thu Apr 3 12:14:36 2025] sendAll: Attempting 508 bytes, sent 508 bytes. [Thu Apr 3 12:14:36 2025] sendAll: Total sent 508 bytes. [Thu Apr 3 12:14:36 2025] LOGON_REQUEST sent. [Thu Apr 3 12:14:36 2025] recvAll: Attempting 252 bytes, received 252 bytes. [Thu Apr 3 12:14:36 2025] Logon round-trip latency: 2.108229 ms [Thu Apr 3 12:14:36 2025] Logon successful. Server: [Thu Apr 3 12:14:36 2025] Synchronized Chicago time: 12:14:36.992 [Thu Apr 3 12:14:36 2025] Waiting until target order time (12:15:0.500) Chicago time... [Thu Apr 3 12:14:36 2025] Received 8 bytes from socket. [Thu Apr 3 12:14:36 2025] Received MARKET_DATA_FEED_STATUS (100). Raw data: 08 00 64 00 02 00 00 00 [Thu Apr 3 12:14:37 2025] NTP offset calculated: -0.000514 seconds. [Thu Apr 3 12:14:37 2025] Updated NTP offset: -0.000514 seconds. [Thu Apr 3 12:15:00 2025] Target time reached. Order send time (Chicago): 12:15:0.500 [Thu Apr 3 12:15:00 2025] === Dumping Order === [Thu Apr 3 12:15:00 2025] Symbol: MNQM25_FUT_CME [Thu Apr 3 12:15:00 2025] Exchange: [Thu Apr 3 12:15:00 2025] ClientOrderID: STOP_ORDER_17437005005013314 [Thu Apr 3 12:15:00 2025] OrderType: 3 [Thu Apr 3 12:15:00 2025] BuySell: 1 [Thu Apr 3 12:15:00 2025] Quantity: 1.000000 [Thu Apr 3 12:15:00 2025] TradeAccount: HIDDEN [Thu Apr 3 12:15:00 2025] FreeFormText: Stop Market Order Test [Thu Apr 3 12:15:00 2025] === End Dump === [Thu Apr 3 12:15:00 2025] sendAll: Attempting 252 bytes, sent 252 bytes. [Thu Apr 3 12:15:00 2025] sendAll: Total sent 252 bytes. [Thu Apr 3 12:15:00 2025] Stop market order submitted: BUY 1.000000 contracts with trigger price 20.000000 [Thu Apr 3 12:15:05 2025] sendAll: Attempting 133 bytes, sent 133 bytes.[Thu Apr 3 12:15:05 2025] Received 102 bytes from socket. [Thu Apr 3 12:15:05 2025] Received LOGOFF message from server. [Thu Apr 3 12:15:05 2025] sendAll: Total sent 133 bytes. [Thu Apr 3 12:15:05 2025] Sent LOGOFF. Disconnecting... [Thu Apr 3 12:15:06 2025] DTC receiver thread exiting. [Thu Apr 3 12:15:37 2025] Trading client terminated. Date Time Of Last Edit: 2025-04-03 20:44:25
|
[2025-04-03 21:29:27] |
Sierra_Chart Engineering - Posts: 19383 |
Yes this absolutely is the problem: | Using relay server mode. Using subscriptions.
There is something wrong with your logon request message. It seems to be misaligned in some way. Or are you deliberately setting relay server mode? Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-04-04 10:59:43] |
User483520 - Posts: 6 |
Below is the current logon request as implemented in client. Code zeroes out the reserved fields and uses the values as defined in official header (version 8): s_LogonRequest logonMsg;
memset(&logonMsg, 0, sizeof(logonMsg)); logonMsg.Size = sizeof(logonMsg); logonMsg.Type = DTC::LOGON_REQUEST; // Should be 1. logonMsg.ProtocolVersion = 8; strncpy_s(logonMsg.Username, sizeof(logonMsg.Username), "HIDDEN", _TRUNCATE); strncpy_s(logonMsg.Password, sizeof(logonMsg.Password), "HIDDEN", _TRUNCATE); strncpy_s(logonMsg.GeneralTextData, sizeof(logonMsg.GeneralTextData), "", _TRUNCATE); // Reserved fields set to 0 as per documentation. logonMsg.Integer_1 = 0; logonMsg.Integer_2 = 0; logonMsg.HeartbeatIntervalInSeconds = 30; // Set TradeMode to simulation mode (typically 2 for simulation). logonMsg.TradeMode = TRADE_MODE_SIMULATED; strncpy_s(logonMsg.TradeAccount, sizeof(logonMsg.TradeAccount), "HIDDEN", _TRUNCATE); strncpy_s(logonMsg.HardwareIdentifier, sizeof(logonMsg.HardwareIdentifier), "", _TRUNCATE); strncpy_s(logonMsg.ClientName, sizeof(logonMsg.ClientName), "DTC C++ Stop Market Order Client", _TRUNCATE); logonMsg.MarketDataTransmissionInterval = -1; I then send this logon request to Sierra. My understanding, based on your documentation, is that if all fields are aligned correctly, the server should accept my request and not force relay mode unless its configuration dictates that behavior. Is there any misalignment or any additional field required to avoid relay mode? I am not trying to deliberately setting relay mode. Date Time Of Last Edit: 2025-04-04 11:01:36
|
[2025-04-04 18:18:14] |
Sierra_Chart Engineering - Posts: 19383 |
We are not sure where you are getting this Logon data structure from. It looks out of date to us. There is no Trade Mode. Get the latest files from here: https://www.sierrachart.com/index.php?page=doc/DTCProtocol.php#DTCFiles Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2025-04-07 15:02:30
|
[2025-04-05 19:43:28] |
User483520 - Posts: 6 |
Most are from DTC files and then some are recommendations from several discussions on the Support Board. I had to get creative and try different things. Anyway, I tried tons of different methods all with the same result. It was not until I rewrote the whole thing in a single-file C# program that I finally came through. I suspect either the environment or network configuration routed my connection through a relay server, perhaps due to legacy settings or specific server-side routing logic. The logon request messages of the two scripts are functionally equivalent. Consider this Support Request solved. Thanks Date Time Of Last Edit: 2025-04-05 20:00:00
|
[2025-04-07 15:03:18] |
Sierra_Chart Engineering - Posts: 19383 |
Okay this is good it is resolved.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: