public OrderBook(int instrument, BuyOrders buyOrders, SellOrders sellOrders, Trades trades,
                         OrderProcessor orderProcessingStrategy)
        {
            if (instrument == null)
            {
                throw new ArgumentNullException("instrument");
            }
            if (buyOrders == null)
            {
                throw new ArgumentNullException("buyOrders");
            }
            if (sellOrders == null)
            {
                throw new ArgumentNullException("sellOrders");
            }
            if (trades == null)
            {
                throw new ArgumentNullException("trades");
            }
            if (orderProcessingStrategy == null)
            {
                throw new ArgumentNullException("orderProcessingStrategy");
            }
            if (!(instrument == buyOrders.Instrument && instrument == sellOrders.Instrument))
            {
                throw new ArgumentException("instrument does not match buyOrders and sellOrders instrument");
            }

            Instrument = instrument;
            BuyOrders  = buyOrders;
            SellOrders = sellOrders;
            Trades     = trades;
            OrderProcessingStrategy = orderProcessingStrategy;
            Statistics = new Statistics();
        }
        public override uint CreateInstrument(uint iid, string symbol)
        {
            instruments[iid]  = new ZInstrument(iid, symbol);
            _instruments[iid] = new OME.Instrument(symbol);

            var instrument = _instruments[iid];

            _buyOrderBook[iid]  = new OME.BuyOrders(instrument);
            _sellOrderBook[iid] = new OME.SellOrders(instrument);
            _trades[iid]        = new OME.Trades(instrument);
            //_tradeProcessor = _trades.TradeProcessingStrategy as Trades.InMemoryTradeProcessor;

            return(iid);
        }
 public OrderBook(int instrument, BuyOrders buyOrders, SellOrders sellOrders, Trades trades)
     : this(
         instrument, buyOrders, sellOrders, trades, new SynchronousOrderProcessor(buyOrders, sellOrders, trades))
 {
 }