public override void onExecutionReport(ExecutionReport report) { Console.WriteLine("Got on onExecutionReport Event."); report.dump(); Console.WriteLine("Status = %d", OrderStatus.OrderStatus_CONFIRMED); if (report.getInstrumentName() == (_data.firstLegSymbol)) { if (report.getOrderStatus() == OrderStatus.OrderStatus_CONFIRMED || report.getOrderStatus() == OrderStatus.OrderStatus_REPLACED) { _data.firstLegOrder.setClOrdId(report.getClOrderId()); _data.firstLegOrder.setOrigClOrdId(report.getOriginalClOrderId()); _data.firstLegOrder.setOrderStatus(OrderStatus.OrderStatus_CONFIRMED); _data.isOrderPending = false; } else if (report.getOrderStatus() == OrderStatus.OrderStatus_FILLED) { placeSecondLegMarket(); _data.isOrderPending = false; } } else if (report.getInstrumentName() == (_data.secondLegSymbol)) { if (report.getOrderStatus() == OrderStatus.OrderStatus_CONFIRMED) { _data.secondLegOrder.setClOrdId(report.getClOrderId()); _data.secondLegOrder.setOrigClOrdId(report.getOriginalClOrderId()); _data.isOrderPending = false; } else if (report.getOrderStatus() == OrderStatus.OrderStatus_FILLED) { Console.WriteLine("Strategy completed successfully."); } } }
public override void onExecutionReport(ExecutionReport report) { Console.WriteLine("Got on onExecutionReport Event."); report.dump(); Console.WriteLine("Status = %d",OrderStatus.OrderStatus_CONFIRMED); if(report.getInstrumentName() == (_data.firstLegSymbol)) { if( report.getOrderStatus() == OrderStatus.OrderStatus_CONFIRMED || report.getOrderStatus() == OrderStatus.OrderStatus_REPLACED ) { _data.firstLegOrder.setClOrdId(report.getClOrderId()); _data.firstLegOrder.setOrigClOrdId(report.getOriginalClOrderId()); _data.firstLegOrder.setOrderStatus(OrderStatus.OrderStatus_CONFIRMED); _data.isOrderPending = false; } else if(report.getOrderStatus() == OrderStatus.OrderStatus_FILLED) { placeSecondLegMarket(); _data.isOrderPending = false; } } else if(report.getInstrumentName() == (_data.secondLegSymbol)) { if(report.getOrderStatus() == OrderStatus.OrderStatus_CONFIRMED) { _data.secondLegOrder.setClOrdId(report.getClOrderId()); _data.secondLegOrder.setOrigClOrdId(report.getOriginalClOrderId()); _data.isOrderPending = false; } else if(report.getOrderStatus() == OrderStatus.OrderStatus_FILLED) { Console.WriteLine("Strategy completed successfully."); } } }