コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
 private static void Parse(XmlNode orderNode, Transaction transaction, out Order order)
 {
     order = new Order();
     order.TransactionId = transaction.Id;
     order.Initialize(orderNode);
 }