Login Page - Create Account

Support Board


Date/Time: Mon, 17 Mar 2025 18:20:09 +0000



Stop all issue

View Count: 810

[2022-09-18 23:42:52]
User785723 - Posts: 58
I am using the following code to send two targets (each for the order quantity of one) and one stop order for all.
The issue is that when target1 is filled, the stop order is canceled but this should not happen as there is still an open position with the quantity of one. Am I doing something wrong?

Variables in "Set Dafaults" are attached for your reference.

// TP1
NewOrder.Target1Price = 100;
NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
NewOrder.OCOGroup1Quantity = 1;
// TP2
NewOrder.Target2Price = 120;
NewOrder.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
NewOrder.OCOGroup2Quantity = 1;
// SL
NewOrder.StopAllPrice = sl;
NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_STOP;

Private File
[2022-09-19 11:34:20]
Sierra_Chart Engineering - Posts: 18809
You need to check the Trade Activity Log for the reason why the stop order is getting canceled:

Trade Activity Log: Viewing Historical Trade Activity
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

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

Login

Login Page - Create Account