Login Page - Create Account

Support Board


Date/Time: Mon, 14 Apr 2025 01:46:47 +0000



[Programming Help] - Issue with Attached Orders – Common Stop Removed After First Target Hits

View Count: 40

[2025-04-11 23:54:36]
User720813 - Posts: 11
Hi Sierra Chart Support,

I'm experiencing a problem when using attached orders with multiple profit targets and a common stop.

Here's the situation:
I'm submitting a 2-contract parent order using sc.BuyEntry() or sc.SellEntry() in ACSIL.

The order includes:

Target 1 at +30 points

Target 2 at +75 points

A single common stop loss at -20 points

This is being submitted with a single parent order using:

order.OrderQuantity = 2;
order.AttachedOrderStop1Type = SCT_ORDERTYPE_STOP;
order.Stop1Offset = 20.0f;
order.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
order.Target1Offset = 30.0f;
order.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
order.Target2Offset = 75.0f;

The Problem:
When Target 1 fills, the common stop is automatically canceled.

This leaves Target 1 exposed with no protective stop.

I do not want to stagger the entries or use separate parent orders — I need this to be handled as a single bracket with two targets and one stop that remains active after the first target fills.

My Question:
Is there a supported way within Sierra Chart to configure this behavior so that:

One stop remains active for the second contract after the first target is hit?

Or is this removal of the common stop after partial fill expected behavior?

If there's a workaround, custom flag, or order configuration that will preserve the stop for the remaining contract, I’d greatly appreciate your guidance.

Thank you,
Adam
[2025-04-12 00:50:57]
Sierra_Chart Engineering - Posts: 19166
This is wrong for what you want to do:


order.AttachedOrderStop1Type = SCT_ORDERTYPE_STOP;
order.Stop1Offset = 20.0f;
order.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
order.Target1Offset = 30.0f;
order.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
order.Target2Offset = 75.0f;

It needs to be:
order.OCOGroup1Quantity = 1;
order.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;
order.Target1Offset = 30.0f;

order.OCOGroup2Quantity = 1;
order.AttachedOrderTarget2Type = SCT_ORDERTYPE_LIMIT;
order.Target2Offset = 75.0f;

order.StopAllOffset = 20.0f;
order.AttachedOrderStopAllType = SCT_ORDERTYPE_STOP;

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