Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 22:51:08 +0000



[Programming Help] - Returning OrderNumber when using sc.FlattenPosition();

View Count: 922

[2018-10-31 09:40:49]
User553714 - Posts: 184
Hi,

When using either sc.FlattenPosition() or sc.FlattenAndCancelAllOrders() how do I return the InternalOrder number of the Order issued to flatten a position?

I would usually use the code below for orders I issue but in the case of the Flatten Functions I don't know the s_SCNewOrder Object name being used to be able to do this?
int& EntryInternalOrderID = sc.GetPersistentInt(x);
s_SCNewOrder NewOrderEntry;
EntryInternalOrderID = NewOrderEntry.InternalOrderID;

Thanks
[2018-11-08 03:35:01]
User553714 - Posts: 184
Hi,

I have again searched the documentation and from what I can understand, since the Flatten related functions do not allow passing in of parameters there would seem to be no way to return the OrderNumberID of the Market order issued to Flatten; if that is the case and I still want to track the OrderNumberID is the solution then to use the Buy/SellExit fuunctions to effectively write my own Flatten like functions since these allow passing in of the s_NewOrdere? Since I use Flatten on quite a few safeguard conditions I wanted to make sure there is no easier way before changing everything over.

Hopefully things have settled down a bit with the workload to allow a response. Thanks.
[2018-11-08 07:15:52]
Sierra Chart Engineering - Posts: 104368
that is the case and I still want to track the OrderNumberID is the solution then to use the Buy/SellExit fuunctions to effectively write my own Flatten like functions
Yes this is the case. It would be good for us to add support for the Internal Order ID number with the sc.FlattenPosition function, but we break compatibility when we do that and we have to implement a different function which is involved.
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
Date Time Of Last Edit: 2018-11-08 07:16:55

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

Login

Login Page - Create Account