Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 17:31:58 +0000



Retrieving Order Data between Main Instance and Sub Instance

View Count: 527

[2023-02-08 19:57:56]
User900285 - Posts: 98
What I was trying to do is get the attached orders s_TradeOrder structure in a sub instance when the primary order was submitted in the main instance.
Normally we can get the Attached Orders very easily if we have the Parent Order structure already saved to start with.

When calling this in a sub instance:
s_SCTradeOrder Target;
sc.GetOrderByOrderID(Order.TargetChildInternalOrderID, Target);
The attached target in this case is not returned.

Then I noticed that these attached orders when viewing the Trade Orders Window in the sub instance do not have the ParentOrderID field.
That should mean that the Order.TargetChildInternalOrderID field is zero when trying to retrieve this information from a sub instance.

Let me know if there is another way to determine if an order is an attached order if it was submitted from the main instance and you want to retrieve it from a sub instance.
Date Time Of Last Edit: 2023-02-08 20:41:58
[2023-02-08 23:35:23]
User900285 - Posts: 98
I do see that the Exchange Order ID field is there for the parent order and it is consistent between the main and the sub instance.

However when trying to access this field via ACSIL in either the main or sub instance, it always prints a 0 value.
To make sure, I performed a few tests with a variable of type uint64_t and was able to print it fine using msg.Format and the %u or %lu flag.
The s_SCTradeOrder structure member TrueExchangeOrderID is returning 0 in the main instance and sub instance of Sierra Chart.
To be clear I did test this on the Teton Order Routing Service and the Trading Evaluator Service. In both of those services the ExchangeOrderID field in the Trade Orders Window was a non zero number.

This variable will still not allow me to determine the attached orders in the sub instance that were submitted in the main instance.
The last idea I had was using the std::string find method to search for particular strings inside of the Order.LastOrderActionSource member.
This method should work for determining if an order is an attached order, if the Teton Service or Trading Evaluator service is used, and if the attached orders are server side.
I noticed is that this field changes depending on a few things including,
1. The Trading Service being used,
2. Whether the sent orders are server side or client side bracket orders.

In the case of the Interactive Brokers service, that field only shows something like "IB Trade Order Action Status".
Date Time Of Last Edit: 2023-02-09 05:33:05
[2023-02-09 23:57:12]
Sierra_Chart Engineering - Posts: 19289
We do see some issues related to the exchange order ID and we will resolve that.

A sub instance does not have access to all of the order details as the main instance does if the orders were entered in the main instance. The detailed information related to attached orders is not known. This will not change.

Here is some related information:
Using DTC Server for Data and Trading in Another Sierra Chart Instance: Differences with Order Handling Between Main and Sub Instance
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: 2023-02-09 23:58:20

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

Login

Login Page - Create Account