Beispiel #1
0
        private void WaitSendingLimitOrder()
        {
            int counter = 0;

            Order.Price             = CalcPassiveOrderPrice(Order.Side);
            TestContent.OrderStatus = OrderStatus.PENDING;
            TraderSubscriber.SendOrder(Order, OrderResponce);

            while (!TestContent.IsOrderSent && counter++ < 100)
            {
                Thread.Sleep(100);
            }

            if (TestContent.OrderStatus == OrderStatus.PENDING)
            {
                try
                {
                    TestTrader.ExecuteOrder(Order);
                }
                catch (Exception ex)
                {
                    TestContent.IsSuccess   = false;
                    TestContent.OrderStatus = OrderStatus.INDEFINITE;
                    Console.WriteLine(ex.Message);
                }
            }
        }
Beispiel #2
0
 public void InitializeTrader()
 {
     TestTrader = new TestTrader();
     TestTrader.Initialize();
 }