Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 11:28:52 +0000



Post From: C++ ACSIL OCO stop/limit order clean implementation

[2022-05-12 19:41:53]
bradh - Posts: 854
You can get the order qty from the trade window, then set the OrderType, Entry Price (Last in this example), Stop as an Offset, and Target as an offset:


s_SCNewOrder NewOrder;
NewOrder.OrderQuantity = sc.TradeWindowOrderQuantity;
NewOrder.OrderType = SCT_ORDERTYPE_LIMIT;
NewOrder.Price1 = sc.Last[sc.Index]; // this is the Entry Price
NewOrder.Target1Offset = TargetTicks.GetInt() * sc.TickSize;
NewOrder.Stop1Offset = StopTicks.GetInt() * sc.TickSize;