internal static void Parse(string exchangeCode,XmlNode transactionNode, List<Transaction> transactions, List<Order> orders, List<OrderRelation> orderRelations) { Transaction transaction = new Transaction(); transaction.Initialize(transactionNode); transactions.Add(transaction); foreach (XmlNode orderNode in transactionNode.ChildNodes) { Order order = new Order(); CommandConvertor.Parse(orderNode,transaction,out order); orders.Add(order); foreach (XmlNode orderRelationNode in orderNode.ChildNodes) { string openOrderPrice = string.Empty; string openOrderID = orderRelationNode.Attributes["OpenOrderID"].Value; Guid openOrderId = new Guid(openOrderID); decimal closeLot = decimal.Parse(orderRelationNode.Attributes["ClosedLot"].Value); if (_OrderRelationOpenPrics.ContainsKey(openOrderID)) { openOrderPrice = _OrderRelationOpenPrics[openOrderID]; } else { openOrderPrice = ExchangeData.GetOrderRelationOpenPrice(exchangeCode, openOrderID); _OrderRelationOpenPrics.Add(openOrderID, openOrderPrice); } OrderRelation relation = new OrderRelation(order.Id, openOrderId, closeLot, openOrderPrice); orderRelations.Add(relation); } } }
internal static void Parse(string exchangeCode,XmlNode transactionNode, out Transaction[] transactions,out Order[] orders, out OrderRelation[] orderRelations) { List<Transaction> transactionList = new List<Transaction>(); List<Order> orderList = new List<Order>(); List<OrderRelation> orderRelationList = new List<OrderRelation>(); CommandConvertor.Parse(exchangeCode,transactionNode, transactionList, orderList, orderRelationList); transactions = transactionList.ToArray(); orders = orderList.ToArray(); orderRelations = orderRelationList.ToArray(); }
private static void Parse(XmlNode orderNode, Transaction transaction, out Order order) { order = new Order(); order.TransactionId = transaction.Id; order.Initialize(orderNode); }
private static void Parse(XmlNode ordersXml, out Order[] orders) { List<Order> orderList = new List<Order>(); foreach (XmlNode orderNode in ordersXml.ChildNodes) { Order order = new Order(); order.Initialize(orderNode); orderList.Add(order); } orders = orderList.ToArray(); }
public bool Remove(Order order) { return this._Orders.Remove(order); }
public void Add(Order order) { bool existed = false; foreach (Order item in this._Orders) { if (item.Id == order.Id) { existed = true; break; } } if (!existed) this._Orders.Add(order); }
internal void UpdateHitOrder(Order newOrder) { this.SetPrice = newOrder.SetPrice; this.HitCount = newOrder.HitCount; this.BestPrice = newOrder.BestPrice; this.BestTime = newOrder.BestTime; this.OrderStatus = newOrder.Status; }
internal void Update(Order order) { this._ExchangeCode = order.ExchangeCode; this._OrderId = order.Id; this._Code = order.Code; this._Phase = order.Phase; this._OrderStatus = order.Status; this._IsBuy = order.BuySell; this._IsOPen = order.OpenClose; this._Lot = order.Lot; this._ContractSize = order.Transaction.ContractSize; this._OrderType = order.Transaction.OrderType; this._OrderTypeString = order.Type; this._SetPrice = order.SetPrice; this._SubmitDateTime = order.Transaction.SubmitTime; this._ExpireTime = order.Transaction.SubmitTime; this._Account = order.Transaction.Account; this._Transaction = order.Transaction; this._Instrument = order.Transaction.Instrument; this._HitCount = order.HitCount; this._BestPrice = order.BestPrice; this._BestTime = order.BestTime; this.ChangeStatus(this._OrderStatus); }
public OrderTask(Order order) { this._BaseOrder = order; this.Update(order); }