示例#1
0
        public void SynthOrderBook_GetBids_Inverted_Test()
        {
            var gbpusdOb = new OrderBook("FE", _gbpusd,
                                         new List <LimitOrder>(), // bids
                                         new List <LimitOrder>    // asks
            {
                new LimitOrder(1.29906m, 50000m),
                new LimitOrder(1.28167m, 2909.98m)
            },
                                         DateTime.Now);

            var bids        = SynthOrderBook.GetBids(gbpusdOb, _usdgbp).ToList();
            var orderedBids = bids.OrderByDescending(x => x.Price).ToList();

            Assert.Equal(2, bids.Count);
            Assert.Equal(bids[0].Price, orderedBids[0].Price);
            Assert.Equal(bids[1].Price, orderedBids[1].Price);
        }
示例#2
0
        public void SynthOrderBook_GetBids_Streight_Test()
        {
            var gbpusdOb = new OrderBook("FE", _gbpusd,
                                         new List <VolumePrice> // bids
            {
                new VolumePrice(1.28167m, 2909.98m),
                new VolumePrice(1.29906m, 50000m)
            },
                                         new List <VolumePrice>(), // asks
                                         DateTime.Now);

            var bids        = SynthOrderBook.GetBids(gbpusdOb, _gbpusd).ToList();
            var orderedBids = bids.OrderByDescending(x => x.Price).ToList();

            Assert.Equal(2, bids.Count);
            Assert.Equal(bids[0].Price, orderedBids[0].Price);
            Assert.Equal(bids[1].Price, orderedBids[1].Price);
        }