Login Page - Create Account

Support Board


Date/Time: Tue, 16 Sep 2025 03:30:49 +0000



Managing mutliple attached orders using ACSIL

View Count: 2316

[2019-07-10 15:15:50]
tomas262 - Posts: 153
Hello,

I trade manually using market orders.

I have managed to build ACSIL code to control attach orders (SL + PT) and adjust them for a slippage on entry (fill price VS indicator signal). This works well when trading 1 contract.

Now I would like to setup a scenario with 3 contracts each having different setup for targets + stops + move to B/E. I would like to manage all these attached orders individually using ACSIL. I see sc.GetNearestTargetOrder() only selects the nearest but I use PT1 30 ticks, PT2 40 ticks and PT3 50 ticks. In case of slippage I want to adjust all of them one by one.

Can it be done using ACSIL? Is there any example around?
[2019-07-10 20:17:27]
TedMar - Posts: 191
Try to manage them with remebered OrderID ,LinkID ...Automated Trading From an Advanced Custom Study: s_SCTradeOrder Structure Members
Date Time Of Last Edit: 2019-07-10 20:17:42
[2019-07-10 23:06:14]
Sierra Chart Engineering - Posts: 104368
You can get any of the orders in ACSIL. Refer to:
Automated Trading From an Advanced Custom Study: Getting Order Information
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: 2019-07-10 23:06:42
[2021-12-03 17:09:10]
JDCII2112 - Posts: 21
Tomas262,

did you get this to work?

I am at the same obstacle.
[2021-12-03 17:14:43]
tomas262 - Posts: 153
Yes, my study now sends the entry mkt order as long as it is allowed by the "control bar CS button" so I get the ID stored. Kind of semi-auto trading. At the entry I record the slippage and ajdust PT&SL orders using IDs I got at the time of entry
Date Time Of Last Edit: 2021-12-03 17:17:24
[2021-12-03 17:26:47]
JDCII2112 - Posts: 21
How did you adjust for slippage? I am trying to accomplish the same in ASCIL and haven't figured it out yet. If you would be so kind to help would be greatly appreciated.
[2021-12-03 17:30:13]
tomas262 - Posts: 153
The entry is triggered by an indicator at bar close. I continuously store the price when indicator is signalling entry into a variable lastUpTrendPrice or lastDownTrendPrice. Then

double slippage = 0.00000f;
if (PositionData.PositionQuantity > 0) slippage = sc.RoundToTickSize(PositionData.AveragePrice - lastUpTrendPrice);
else if (PositionData.PositionQuantity < 0) slippage = sc.RoundToTickSize(lastDownTrendPrice - PositionData.AveragePrice);

[2021-12-03 17:43:06]
JDCII2112 - Posts: 21
Cool. Thank you! I had a similar code but it was about 20 lines longer. New to coding. I greatly appreciate your help!

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

Login

Login Page - Create Account