Support Board
Date/Time: Sun, 08 Sep 2024 00:07:04 +0000
[Programming Help] - DTC SUBMIT_NEW_SINGLE_ORDER does not submit order
View Count: 470
[2023-08-17 13:10:54] |
User258363 - Posts: 11 |
When I place a trade through sending a `SUBMIT_NEW_SINGLE_ORDER` command no trade is placed and I see no response in the message log. I can see the command go through in the message log but there is no response or indication that a trade was placed. SC also shows no trades. If I remove "order_type" I get an error in the trade log that says: DTC client #34. DTC Client. 127.0.0.1 | New order rejected. ClientOrderID: 10 | OrderType field is not set | Symbol: ESU3.CME | TradeAccount: <account_redacted> | 2023-08-17 04:40:15.068 *
so this leads me to believe something is happening but the trade isn't being placed. changing trade_account string doesn't seem to result in any error either. I've tried with tcp and websockets. commands: symbol=ESU3.CME, exchange="CME", trade_account="xxx", client_order_id = "13", order_type=1, buy_sell=1, quantity=1, time_in_force=1, is_automated_order=1, open_or_close=1, is_parent_order=0, message log: JSON data: {"BuySell": 1, "ClientOrderID": "13", "Exchange": "CME", "IsAutomatedOrder": 1, "IsParentOrder": 0, "OpenOrClose": 1, "OrderType": 1, "Quantity": 1, "Symbol": "ESU3.CME", "TimeInForce": 1, "TradeAccount": <redacted>, "Type": 208} | 2023-08-17 13:05:27.272 attached is a screenshot of my dtc server settings. trading is enabled. also a related post here: DTC Submit Market Order Date Time Of Last Edit: 2023-08-17 13:14:34
|
![]() |
[2023-08-17 14:16:47] |
Sierra_Chart Engineering - Posts: 16292 |
Do you see the order listed in Trade >> Trade Orders Window?
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 |
[2023-08-17 14:26:18] |
User258363 - Posts: 11 |
no I don't. That window is completely blank. I've sent many orders while fiddling with the values being sent and none of them have registered as a BUY. edit: I just noticed that in the server settings for DTC there is a dtc protocol clients "read only" I can't set this to false. is that what's causing the issue? See my screenshot in the original post
Date Time Of Last Edit: 2023-08-17 15:16:48
|
[2023-08-17 16:45:39] |
Sierra_Chart Engineering - Posts: 16292 |
No that is not the issue. So you are using JSON encoding?
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 |
[2023-08-17 17:05:19] |
User258363 - Posts: 11 |
I've tried with 2 implementations 1. python + websockets + json encoding 2. golang + tcp + protocol buffers both have the same result. no response from trade request. not even an error unless I remove a required field like order_type. to make it easier to debug I've uploaded the code here: https://github.com/mason/python-ws-dtc-client/commits/master the exact line that sends the trade is here: https://github.com/mason/python-ws-dtc-client/blob/master/example_client.py#L39 run it like so python example_client.py -n 127.0.0.1 -p 11099 -s -q 11098
might need to pip install dependencies pip install websocket_client
pip install flask pip install Flask-Sockets pip install gevent-websocket Date Time Of Last Edit: 2023-08-17 17:07:27
|
[2023-08-21 17:45:47] |
User258363 - Posts: 11 |
Hi just checking up on this thread. Any ideas what could be wrong or are we still investigating? Thanks!
|
[2024-05-08 04:05:48] |
Zorin - Posts: 19 |
Just for anyone who'll be playing with DTC::s_SubmitNewSingleOrder The working line is: {"Type":208,"Symbol":"ESM24-CME","Exchange":"","TradeAccount":"Sim3","ClientOrderID":"123592","OrderType":2,"BuySell":1,"Price1":5200.5,"Price2":0.0,"Quantity":1.0,"TimeInForce":0,"GoodTillDateTime":0,"IsAutomatedOrder":0,"IsParentOrder":0,"FreeFormText":"","OpenOrClose":0,"MaxShowQuantity":0.0,"Price1AsString":"","Price2AsString":"","IntendedPositionQuantity":0.0} In the DTC::s_SubmitNewSingleOrder dtcNewSingleOrd; // By whatever reason, copying from another order - like below - does NOT work dtcNewSingleOrd.OrderType = dtcMsgTEMP.GetOrderType(); // ?? dtcNewSingleOrd.BuySell = dtcMsgTEMP.GetBuySell(); // ?? dtcNewSingleOrd.Price1 = dtcMsgTEMP.GetPrice1(); // ?? dtcNewSingleOrd.Quantity = dtcMsgTEMP.OrderQuantity; dtcNewSingleOrd.TimeInForce = dtcMsgTEMP.GetTimeInForce(); dtcNewSingleOrd.GoodTillDateTime = dtcMsgTEMP.GetGoodTillDateTime(); // Proper syntax - use values, not functions: dtcNewSingleOrd.OrderType = dtcMsgTEMP.OrderType; // ?? dtcNewSingleOrd.BuySell = dtcMsgTEMP.BuySell; // ?? dtcNewSingleOrd.Price1 = dtcMsgTEMP.Price1 / 100; // ?? dtcNewSingleOrd.Quantity = dtcMsgTEMP.OrderQuantity; dtcNewSingleOrd.TimeInForce = dtcMsgTEMP.TimeInForce; dtcNewSingleOrd.GoodTillDateTime = dtcMsgTEMP.GoodTillDateTime; // The values of following fields should be explicitly assigned dtcNewSingleOrd.SetClientOrderID ("123592"); You should see your new order on your SierraChart screen - if/when submitted [and accepted] successfully. Date Time Of Last Edit: 2024-05-08 08:06:45
|
To post a message in this thread, you need to log in with your Sierra Chart account: