Support Board
Date/Time: Fri, 07 Feb 2025 18:17:42 +0000
Post From: ACSIL - Internal Order ID given to sc.ModifyOrder is 0
[2020-06-06 11:36:38] |
ForgivingComputers.com - Posts: 996 |
Second, the way I modify orders has always been working since I created my first algo and I use the same piece of code in every strategy where I have a trailing stop loss, so why would an issue occurs now?
If it worked live in a previous version, then you should be able to pin down the version it stopped working at by going back and recompiling on older versions and testing. There have been a number of changes since version 2092. IF the trade is being flattened as a result of the sc.ModifyOrder error, then there should be a record of why it is being flattened in the Trade Activity Log. Something else may be going on. Also, this section of code may not be executing as expected. I would debug all the parameters to confirm their values: if(StopOrder.OrderStatusCode == SCT_OSC_OPEN && PositionData.PositionQuantity != 0 && NewPossibleStop > currentStop && NewPossibleStop > orderStop) { s_SCTradeOrder ExistingOrder; if(sc.GetOrderByOrderID(OrderId, ExistingOrder) != SCTRADING_ORDER_ERROR && ExistingOrder.OrderStatusCode == SCT_OSC_FILLED) { ... } Good Luck! |