public void SendOrderStatusRequest(FIXOrderStatusRequest request)
 {
     throw new NotImplementedException();
 }
        public void SendOrderStatusRequest(FIXOrderStatusRequest request)
        {
            if (!this.isConnected)
            {
                this.EmitError(this.Id, -1, "The TDXTradeProvider is not connected.");
            }
            string      outerOrderID = request.OrderID;
            OrderRecord orderRecord  = this.orders.GetRecord(outerOrderID, 1);

            if (orderRecord == null)
            {
                orderRecord = new OrderRecord();
                SingleOrder order = (SingleOrder)OrderManager.Orders.All[request.OrderID];
                if (order != null)
                {
                    orderRecord.TransactTime = order.TransactTime;
                    orderRecord.OrderQty     = (long)order.OrderQty;
                    orderRecord.OrderPrice   = order.Price;
                    orderRecord.SecurityID   = order.SecurityID;
                    switch (order.OrdStatus)
                    {
                    case OrdStatus.New:
                        orderRecord.OrderStatus = OrderStatus.New;
                        break;

                    case OrdStatus.PartiallyFilled:
                        orderRecord.OrderStatus = OrderStatus.PartiallyFilled;
                        break;

                    case OrdStatus.Filled:
                        orderRecord.OrderStatus = OrderStatus.Filled;
                        break;

                    case OrdStatus.PendingCancel:
                        orderRecord.OrderStatus = OrderStatus.PendingCancel;
                        break;

                    case OrdStatus.Cancelled:
                        orderRecord.OrderStatus = OrderStatus.Cancelled;
                        break;

                    case OrdStatus.Rejected:
                        orderRecord.OrderStatus = OrderStatus.Rejected;
                        break;

                    default:
                        orderRecord.OrderStatus = OrderStatus.New;
                        break;
                    }
                    orderRecord.OuterOrderID = order.ClOrdID;
                    orderRecord.AvgPx        = order.AvgPx;
                    orderRecord.CumQty       = (long)order.CumQty;
                    switch (order.Side)
                    {
                    case (Side.Buy):
                        orderRecord.OrderSide = OrderSide.Buy;
                        break;

                    case (Side.Sell):
                        orderRecord.OrderSide = OrderSide.Sell;
                        break;

                    default:
                        throw new Exception("不支持的买卖指令。");
                    }
                    lock (this.orders)
                    {
                        this.orders.AddRecord(orderRecord, null, outerOrderID);
                    }
                }
            }
            this.updateOrders();
        }
Exemplo n.º 3
0
 public void SendOrderStatusRequest(FIXOrderStatusRequest request)
 {
     throw new NotImplementedException();
 }