Login Page - Create Account

Support Board


Date/Time: Wed, 12 Mar 2025 16:35:17 +0000



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

[2022-05-12 19:41:53]
ForgivingComputers.com - Posts: 1021
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;