Login Page - Create Account

Support Board


Date/Time: Sun, 23 Feb 2025 22:05:34 +0000



Post From: replacing stop order with trailing order

[2021-02-16 20:27:10]
User61576 - Posts: 445
I am entering a position with maket order and a stop
after achieving target 1 I would like to update my stop to trailing stop

as of now, I managed to update my stop to move to b/e but failing with the trailing

this is how I update my stop to be b/e
newStopPrice = mktPrice + (1 * sc.TickSize);//calc of b/e + 1 tick
s_SCNewOrder ModifyOrder;
ModifyOrder.InternalOrderID = mktBuyStop1OrderID;
ModifyOrder.OrderQuantity = totalBuyOrderSubmitted - totalExits;
ModifyOrder.Price1 = newStopPrice;
sc.ModifyOrder(ModifyOrder);

and this is what I am trying to do with the trailing
s_SCNewOrder ModifyOrder;
ModifyOrder.InternalOrderID = mktBuyStop1OrderID;
ModifyOrder.OrderQuantity = totalBuyOrderSubmitted - totalExits;
ModifyOrder.OrderType = SCT_ORDERTYPE_TRAILING_STOP;
ModifyOrder.StopAllOffset = 8 * sc.TickSize;
sc.ModifyOrder(ModifyOrder);

a practical example will be appreciated

thanks