Login Page - Create Account

Support Board


Date/Time: Mon, 09 Jun 2025 19:09:44 +0000



[Programming Help] - ASCIL How to determine when/if an Attached Order has been moved to Breakeven ...

View Count: 451

[2022-11-20 11:43:10]
User92573 - Posts: 563
Dear Support

I've not been able to find an example, or documentation, to explain how I can determine when an attached stoploss order moves to breakeven.

I can obviously use <= or >= a trigger value but I could not find another more appropriate method that traps the actual Order event.

The goal is to simply send a message to the log stating a move to Breakeven has occurred and at what price?

I currently save the following to PerVars for my other studies which do not use attached orders.

NewOrder.Target1InternalOrderID;
NewOrder.Stop1InternalOrderID;
NewOrder.InternalOrderID;

But with attached orders I'm a little stuck. Any short example, or direction greatly appreciated.

Many thanks.
[2022-11-29 10:36:46]
ForgivingComputers.com - Posts: 1063
I've not been able to find an example, or documentation, to explain how I can determine when an attached stoploss order moves to breakeven.

If you are keeping track of the order IDs for the stops, then you can look up the current Price like this:

s_SCTradeOrder TradeOrder;
sc.GetOrderByOrderID(OrderID, TradeOrder);
double Stop = TradeOrder.Price1;
[code]

[2022-12-01 19:27:44]
User92573 - Posts: 563
Yes, I track all Order ID's but other than testing the Stop price against the Trade Order Price, or the current Stop against the Stoploss, I could not identify a specific Breakeven, or trigger flag. I suppose these solutions are adequate, but I felt there would be a flag of sorts.

Thank you for replying.
[2022-12-01 19:40:58]
ForgivingComputers.com - Posts: 1063
Not sure what kind of flag you are looking for, as I don't know how you would see the flag without an if statement or equivalent. You can also check the result of the sc.ModifyOrder() to know if it succeeded, assuming your study initiated the move to BE.
Date Time Of Last Edit: 2022-12-01 19:41:45
[2022-12-04 12:20:05]
User92573 - Posts: 563
It wasn't so much me creating a flag on a change of values. I thought there might be a specific event that Sierra tracked but the test using ID's and creating my own event flag is clearly a solution.

Thank you for reply.
Date Time Of Last Edit: 2022-12-04 12:21:02

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

Login

Login Page - Create Account