Support Board
Date/Time: Tue, 09 Sep 2025 19:01:15 +0000
[Programming Help] - DTC Order sending only sends sell orders but not buy order.
View Count: 233
[2025-07-28 17:22:47] |
User370774 - Posts: 32 |
Hi, thank you in advance for your time looking into this. I have a perfectly working little python script that on execution sends a SELL order to Sierra Chart via DTC(JSON compact), order opens, I'm short, I'm happy. But when I switch it to send a BUY order, no order gets opened in SC. As far as I know, in order to send a BUY order I only have to set a 1 instead of a 2 "BuySell": 1 The Sierra log as well as the Terminal log on the python(client) side seem to not indicate any difference (unless I missed it). I'll attach both logs and the small script. Hopefully one of you can spot the problem bc I'm lost. Thank you so much! |
Private File ![]() ![]() |
[2025-07-28 22:11:54] |
User370774 - Posts: 32 |
It gets more strange, when I set it to "1" it appears as invisible LIMIT BUY order without a price! (see attached screenshot) Even though OrderType is set to "2" (market order), which works correctly for sending a sell order. order = { "Type": 208, "ClientOrderID": str(uuid.uuid4()), "Symbol": "NQU5.CME", "TradeAccount": "Sim2", "Quantity": 1, "OrderType": 2, "BuySell": 1, # 1 should be "BUY", but only 2 for "SELL" works "TimeInForce": 0, "IsAutomatedOrder": 1, UPDATE: if I send a LIMIT BUY order it executes as MARKET BUY! Could be a DTC bug? At least I have a workaround now. I send limits when I want markets for buy :) Until you fix it and my account blows haha. "IsParentOrder": 0 } Date Time Of Last Edit: 2025-07-28 22:35:44
|
![]() |
[2025-07-28 22:15:46] |
Sierra_Chart Engineering - Posts: 20852 |
It is not clear what the issue is. There must be something wrong on your side. Are you sending a null terminator character after each message. Have you set the DTC protocol server encoding to JSON? Or did you send an encoding request specifying the encoding to be JSON? 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-07-28 22:54:57] |
User370774 - Posts: 32 |
My DTC sierra is set to JSON compact (attached setting) So it kinda works now for me if I send a market order with a price it gets executed as limit at that price and vice versa a limit buy becomes a market buy. If its a bug I can live with the workaround but if its my code then I rather find the fix of course. Let me know what you think about my settings in the screenshot. Maybe I should try something else than JSON compact and rewrite my script accordingly to binary or something? Date Time Of Last Edit: 2025-07-28 23:23:28
|
![]() |
[2025-07-28 23:33:03] |
Sierra_Chart Engineering - Posts: 20852 |
JSON is fine, and you are not using the compact version. We do not see any obvious problems. We are going to check on debug logging to help you determine the problem. 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-07-28 23:33:24
|
[2025-07-29 04:10:58] |
User370774 - Posts: 32 |
Is there maybe a way to send a buy or sell signal other than an order through DTC? Maybe that "UserMessage", if there is a way to capture/receive that on the ACSIL side? That way I would have full control over the order type and order management within SC. I would have BE and trailing and any other custom oders I wrote in ACSIL. That would be ideal. Worst case I could "listen" for a market order with an ACSIL study and then attach order brackets to that and apply management logic. Just a signal would be cleaner despite a tiny bit more latency maybe. Date Time Of Last Edit: 2025-07-29 04:13:40
|
[2025-07-30 05:32:59] |
User370774 - Posts: 32 |
buy side swapped to not backwards some time today probably after updates, thank you! Another thing I noticed but its not a problem at all is the price has to be off two digits to get into SC correctly vie DTC. (scrshot attached) Anyway you have more important things, thank you for your help! Please do let me know if you have any signal or message that DTC can transport that can be read from ACSIL side and can serve as buy/sell signal!? |
![]() |
To post a message in this thread, you need to log in with your Sierra Chart account: