void bwOrder_BWOrderUpdateEvent(object sender, BWOrderStatus BWOrderStatus) { BWOrder bwo = (BWOrder)sender; long id = (long)bwo.CustomID; Order o = new OrderImpl(bwo.Symbol, (int)bwo.Size); o.id = (long)bwo.CustomID; o.side = (bwo.OrderSide == ORDER_SIDE.SIDE_BUY) || (bwo.OrderSide == ORDER_SIDE.SIDE_COVER); o.price = (decimal)bwo.LimitPrice; o.stopp = (decimal)bwo.StopPrice; o.Account = bwo.UserID.ToString(); o.ex = bwo.Venue.ToString(); switch (BWOrderStatus) { case BWOrderStatus.ACCEPTED: { tl.newOrder(o); v(o.symbol + " sent order acknowledgement for: " + o.ToString()); if (_bwOrdIds.ContainsKey(o.id)) { _bwOrdIds[o.id] = bwo.OrderID; } } break; case BWOrderStatus.CANCELED: { tl.newCancel(id); v("sent cancel notification for order: " + id); } break; case BWOrderStatus.REJECTED: { tl.newCancel(id); debug("Rejected: " + bwo.CustomID.ToString() + bwo.RejectReason); } break; } }