If two orders are linked via a CreateOROGroup, it means that once the one order has been executed, the order size of the second order is reduced by the order volume of the first order.
Copy CreateOROGroup (IEnumerable < IOrder > orders)
Copy private IOrder oStopLong = null ;
private IOrder oLimitLong = null ;
protected override void OnInit ()
{
IsAutoConfirmOrder = false ;
}
protected override void OnCalculate ()
{
oStopLong = SubmitOrder ( new StrategyOrderParameters
{
Direction = OrderDirection . Buy ,
Type = OrderType . Stop ,
Quantity = DefaultOrderQuantity ,
StopPrice = Close [ 0 ] * - 1.1 ,
SignalName = "strategyName" ,
});
oLimitLong = SubmitOrder ( new StrategyOrderParameters
{
Direction = OrderDirection . Buy ,
Type = OrderType . Limit ,
Quantity = DefaultOrderQuantity * 0.5 ,
Price = Close [ 0 ] * 1.1 ,
SignalName = "strategyName" ,
});
CreateOROGroup ( new List < IOrder > { oLimitLong , oStopLong });
}