public override void Update(OrderSucceeded item)
        {
            Order order = GetOrder(item.Cookie);

            if (order == null)
            {
                return;
            }

            OrderDeliveryConfirmation confirmation = new OrderDeliveryConfirmation(order, item.DateTime);

            this.logger.Log(String.Format("{0:dd/MM/yyyy H:mm:ss.fff}, {1}, сформировано уведомление о доставке заявки {2}",
                                          BrokerDateTime.Make(DateTime.Now),
                                          this.GetType().Name,
                                          confirmation.ToString()));

            this.tradingData.Get <ObservableHashSet <OrderDeliveryConfirmation> >().Add(confirmation);
        }
Esempio n. 2
0
        public void OrderDeliveryConfirmation_ToString_test()
        {
            Order order =
                new Order(1,
                          BrokerDateTime.Make(DateTime.Now),
                          "BP12345-RF-01",
                          "RTS-9.13_FT",
                          TradeAction.Buy,
                          OrderType.Limit,
                          10,
                          136000,
                          0);

            DateTime deliveryDate = BrokerDateTime.Make(DateTime.Now).AddSeconds(1);
            OrderDeliveryConfirmation orderDeliveryConfirmation =
                new OrderDeliveryConfirmation(order, deliveryDate);

            string result = String.Format("Order delivery confirmation for: {0}, {1}",
                                          orderDeliveryConfirmation.OrderId,
                                          orderDeliveryConfirmation.DateTime.ToString(CultureInfo.InvariantCulture));

            Assert.AreEqual(result, orderDeliveryConfirmation.ToString());
        }