Support Board
Date/Time: Sun, 23 Feb 2025 22:03:02 +0000
Post From: replacing stop order with trailing order
[2021-02-17 16:05:09] |
User61576 - Posts: 445 |
I saw that example but my order management was written a long time ago and I don't want to rewrite it. just wanted to add an option of trailing stop only after target 1 is filled. i tried this as well but it's not working: sc.CancelOrder(mktBuyStop1OrderID);//cancell the original stop order as I can not update it's type
s_SCNewOrder NewOrder; NewOrder.OrderQuantity = totalBuyOrderSubmitted - totalExits; NewOrder.StopAllOffset = mktPrice + 8 * sc.TickSize; NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_TRAILING_STOP; NewOrder.TrailStopStepPriceAmount = mktPrice + 4 * sc.TickSize; int Result = (int)sc.SellEntry(NewOrder); I will be happy to learn what I am doing wrong thanks |