Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 16:17:53 +0000



DTC Bracket Order ignoring parent and executing

View Count: 703

[2018-04-09 19:21:41]
User942837 - Posts: 108
Hi, I am submitting 2 messages via json to DTC server. I am first sending SUBMIT_NEW_SINGLE_ORDER as a parent order, then SUBMIT_NEW_OCO_ORDER with a stop and a target. In the SUBMIT_NEW_SINGLE_ORDER I am setting ParentTriggerClientOrderId that I used in the SUBMIT_NEW_SINGLE_ORDER.

E.g. My entry price is
double entry = 2637;
double target = 2640.25;
double stop = 2635.25;

As soon as I send SUBMIT_NEW_OCO_ORDER, and market is trading above my target (2640.25), the 2640.25 sell Lmt OCO gets executed at market. With the example I have provided below what I am expecting is to have a buy LMT order (parent) waiting to be filled and the 2 OCOs will only get executed after the parent order is filled. Could you kindly let me know what am I doing wrong please?

Thank you

string clientOrderId = "43ddfs51aa";
string clientOrderId1 = "454334aa";
string clientOrderId2 = "454334bb";

double entry = 2637;
double target = 2640.25;
double stop = 2635.25;

byte[] SUBMIT_NEW_SINGLE_ORDER = JsonMessageToByteArray("{\"Type\":208,\"Symbol\":\"ESM8\",\"ClientOrderID\":\"" + clientOrderId + "\",\"OrderType\":2,\"BuySell\":1,\"Price1\":" + entry + ",\"TimeInForce\":1,\"Quantity\":1,\"TradeAccount\":\"DEMOAC\",\"IsAutomatedOrder\":0,\"IsParentOrder\":1,\"OpenOrClose\":1}");
SendAndReceive(dtcSocket, SUBMIT_NEW_SINGLE_ORDER);


string SUBMIT_NEW_OCO_ORDER = "{\"Type\":201,\"Symbol\":\"ESM8\",\"ClientOrderID_1\":\"" + clientOrderId1 + "\",\"OrderType_1\":2,\"BuySell_1\":3,\"Price1_1\":" + stop + ",\"Quantity_1\":1,\"ClientOrderID_2\":\"" + clientOrderId2 + "\",\"OrderType_2\":2,\"BuySell_2\":2,\"Price1_2\":" + target + ",\"Quantity_2\":1,\"TimeInForce\":1,\"IsAutomatedOrder\":0,\"TradeAccount\":\"DEMO0AC\",\"ParentTriggerClientOrderId\":\"" + clientOrderId + "\",\"OpenOrClose\":2,\"PartialFillHandling\":1}";
SendAndReceive(dtcSocket, JsonMessageToByteArray(SUBMIT_NEW_OCO_ORDER));
[2018-04-09 19:42:58]
Sierra Chart Engineering - Posts: 104368
We know the problem relates to these fields:
IsParentOrder
ParentTriggerClientOrderID

In your code ParentTriggerClientOrderId is the wrong case. These are case sensitive.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-04-09 19:55:50]
User942837 - Posts: 108
thank you! :) Spot on, I would not have noticed it.Next time I should copy and paste.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account