private void OrderStatusCallback( Int32 mode, Int32 transId, Double number, [MarshalAs(UnmanagedType.LPStr)] string classCode, [MarshalAs(UnmanagedType.LPStr)] string secCode, Double price, Int32 balance, Double value, Int32 isSell, Int32 status, Int32 orderDescriptor) { var order = new OrderInfo() { Balance = balance, ClassCode = classCode, Direction = TypeConverter.GetDirection(isSell), Mode = (OrderInfoMode)mode, Number = number, OrderDescriptor = orderDescriptor, Price = price, SecCode = secCode, Status = TypeConverter.GetStatus(status), TransId = transId, Value = value }; var orderDetails = OrderInfoDetails.Fetch(order.OrderDescriptor); this.OnOrderStatusChanged(new OrderInfoEventArgs(order, orderDetails)); }
internal static OrderInfoDetails Fetch(Int32 orderDescriptor, OrderInfoTimeType infoTimeType = OrderInfoTimeType.QuikDate) { var od = new OrderInfoDetails(); if (orderDescriptor <= 0) { return(od); } od.Qty = OrderEntryPoint.Qty(orderDescriptor); od.Date = OrderEntryPoint.Date(orderDescriptor); od.Time = OrderEntryPoint.Time(orderDescriptor); od.OrderDateTime = OrderEntryPoint.DateTime(orderDescriptor, (int)infoTimeType); od.ActivationTime = OrderEntryPoint.ActivationTime(orderDescriptor); od.WithdrawTime = OrderEntryPoint.WithdrawTime(orderDescriptor); od.Expiry = OrderEntryPoint.Expiry(orderDescriptor); od.AccuredInt = OrderEntryPoint.AccuredInt(orderDescriptor); od.Yield = OrderEntryPoint.Yield(orderDescriptor); od.Uid = OrderEntryPoint.Uid(orderDescriptor); od.VisibleQty = OrderEntryPoint.VisibleQty(orderDescriptor); od.Period = (OrderInfoPeriod)OrderEntryPoint.Period(orderDescriptor); od.FileTime = TypeConverter.GetDateTime(OrderEntryPoint.FileTime(orderDescriptor)); od.WithdawFileTime = TypeConverter.GetDateTime(OrderEntryPoint.WithdawFileTime(orderDescriptor)); od.UserId = OrderEntryPoint.UserId(orderDescriptor); od.Account = OrderEntryPoint.Account(orderDescriptor); od.BrokerRef = OrderEntryPoint.BrokerRef(orderDescriptor); od.ClientCode = OrderEntryPoint.ClientCode(orderDescriptor); od.FirmId = OrderEntryPoint.FirmId(orderDescriptor); return(od); }
public OrderInfoEventArgs(OrderInfo orderInfo, OrderInfoDetails orderInfoDetails) { this.OrderInfo = orderInfo; this.OrderInfoDetails = orderInfoDetails; }