Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 13:05:44 +0000



[Programming Help] - Retrieving Sierra-Generated Order ID in ACSIL for v2749

View Count: 95

[2025-04-06 01:03:13]
User936941 - Posts: 28
I'm sierrachart.h and scdatetime.h from D:\SierraChart\ACS_Source. The main issue is struggling to retrieve the Sierra-generated order ID to cancel orders with time-based cancellation logic (set to 120 seconds). The call to sc.CancelOrder(sierraOrderID) is attempting to cancel using SierraID=122, which fails with CancelResult=-1, 122 is obviously not a sierra generated order id. I’ve reset persistent storage to clear stale values, switched from s_SCTradeOrder.OrderID to InternalOrderID after compile errors showed OrderID isn’t recognized, and relied on sc.SellOrder’s return value—yet cancellation still fails. What’s the best way to get the correct Sierra order ID in v2749 for successful cancellation?
[2025-04-18 07:57:03]
Sierra_Chart Engineering - Posts: 19285
What you are referring to is the Internal Order Identifier and when submitting an order from ACSIL this internal order identifier will be set into the new order structure.:
Automated Trading From an Advanced Custom Study: [Type: integer] s_SCNewOrder::InternalOrderID
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