示例#1
0
        public void TestGetOpeningPriceAndVolume3()
        {
            IOrderAccessService orderAccessService = new OrderAccessService(true, @"MockOrdersWithMultipleMatchingPointAndImbalance.txt", @"MockOrdersSummary.txt");
            var orders           = orderAccessService.GetOrders();
            var lastClosingPrice = orderAccessService.GetLastClosingPrice();

            var calculator       = new Calculator();
            var normalizedOrders = calculator.GetNormalizedOrders(orders);

            var result = calculator.PredictOpeningPrice(normalizedOrders, lastClosingPrice);

            Assert.Equal(97.5, result.Item1);
            Assert.Equal(140, result.Item2);
        }
示例#2
0
        public void TestGetNormalizedOrders()
        {
            IOrderAccessService orderAccessService = new OrderAccessService(true, @"MockOrders.txt", @"MockOrdersSummary.txt");
            var orders = orderAccessService.GetOrders();

            var calculator       = new Calculator();
            var normalizedOrders = calculator.GetNormalizedOrders(orders);

            normalizedOrders.ForEach(order =>
            {
                Trace.WriteLine(
                    $"{order.BidVolume}|{order.Price}|{order.MatchVolume}|{order.AskVolume}");
            });

            Assert.Equal(9, normalizedOrders.Count);
        }