private static void EmitOrderCancelReject(object sender, OrderCancelRejectEventArgs e) { if (ProviderManager.threadSafe) Monitor.Enter(ProviderManager.dataLock); try { if (ProviderManager.OrderCancelReject != null) ProviderManager.OrderCancelReject(sender, e); } finally { if (ProviderManager.threadSafe) Monitor.Exit(ProviderManager.dataLock); } }
private void SQ_OrderManager_OrderCancelReject(object sender, OrderCancelRejectEventArgs args) { SingleOrder order = ((InstrumentOrderListTable)OrderManager.Orders).All[args.OrderCancelReject.OrigClOrdID] as SingleOrder; StrategyRunner strategyRunner = (StrategyRunner)null; if (!this.strategies.TryGetValue(order.Strategy, out strategyRunner) || !strategyRunner.Enabled) return; if (args.OrderCancelReject.CxlRejResponseTo == CxlRejResponseTo.CancelReplaceRequest) strategyRunner.SetOrderReplaceReject(order); else strategyRunner.SetOrderCancelReject(order); }
private void OrderManager_OrderCancelReject(object sender, OrderCancelRejectEventArgs args) { lock (this) { ++this.countReject; ++this.countExecutionTotal; } }
private static void OnOrderCancelReject(object sender, OrderCancelRejectEventArgs e) { OrderCancelReject orderCancelReject = e.OrderCancelReject; SingleOrder order = OrderManager.orders.All[orderCancelReject.OrigClOrdID] as SingleOrder; if (orderCancelReject.OrdStatus == OrdStatus.Undefined) { orderCancelReject.OrdStatus = OrdStatus.New; ArrayList arrayList = new ArrayList((ICollection)order.Reports); arrayList.Reverse(); foreach (ExecutionReport executionReport in arrayList) { switch (executionReport.OrdStatus) { case OrdStatus.PendingCancel: case OrdStatus.PendingNew: case OrdStatus.PendingReplace: continue; default: orderCancelReject.OrdStatus = executionReport.OrdStatus; goto label_10; } } } label_10: OrdStatus ordStatus = order.OrdStatus; order.EmitCancelReject(orderCancelReject); if (OrderManager.OrderCancelReject != null) OrderManager.OrderCancelReject(sender, new OrderCancelRejectEventArgs(order, orderCancelReject)); if (order.IsDone) { if (!OrderManager.EnablePartialTransactions) OrderManager.nf3XP7Xf3(order, orderCancelReject.TransactTime, order.AvgPx, order.CumQty); OrderManager.YUArMfFNj(order); } else { if (ordStatus == order.OrdStatus) return; OrderManager.orders.Update(order); order.EmitStatusChanged(); OrderManager.EmitOrderStatusChanged(order); } }