Example #1
0
        public void TestAccountTodayOrder_SendOrder()
        {
            AccountTodayOrder todayOrder = new AccountTodayOrder();

            string    code   = "m1705";
            OrderInfo order  = new OrderInfo(code, 20170601.093101, OpenCloseType.Open, 3110, 15, OrderSide.Buy);
            OrderInfo order2 = new OrderInfo(code, 20170601.093201, OpenCloseType.Open, 3120, 15, OrderSide.Buy);

            todayOrder.SendOrder(order);
            todayOrder.SendOrder(order2);

            int tradeMount = todayOrder.CalcOrder(order, 3115, 10);

            Assert.AreEqual(0, tradeMount);

            tradeMount = todayOrder.CalcOrder(order2, 3115, 10);
            Assert.AreEqual(10, tradeMount);

            todayOrder.CancelOrder(order.OrderID);
            Console.WriteLine(todayOrder);
        }
Example #2
0
 public AccountTrade(double money, AccountFee accountFee)
 {
     this.accountOrder    = new AccountTodayOrder();
     this.accountPosition = new AccountPosition(money, accountFee);
 }