Пример #1
0
        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 void Init()
 {
     m_Instrument = 1;
     m_BuyOrder = new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilCancelled, Order.BuyOrSell.Buy, 100,
                                  100ul);
     m_SellOrder = new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilCancelled, Order.BuyOrSell.Sell, 90,
                                   100ul);
     m_SellOrders = new SellOrders(m_Instrument);
     m_BuyOrders = new BuyOrders(m_Instrument);
     m_SellOrders.Insert(m_SellOrder);
     m_BuyOrders.Insert(m_BuyOrder);
     m_Trades = new Trades(m_Instrument);
     m_TradeProcessor = m_Trades.TradeProcessingStrategy as Trades.InMemoryTradeProcessor;
 }
        public void Init()
        {
            m_Instrument = new Instrument("MSFT");
            m_BuyOrders = new BuyOrders(m_Instrument);
            m_SellOrders = new SellOrders(m_Instrument);
            m_Trades = new Trades(m_Instrument);

            m_OrderBook = new OrderBook(m_Instrument, m_BuyOrders, m_SellOrders, m_Trades);

            m_Orders = new List<Order>
            {
                new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilCancelled, Order.BuyOrSell.Buy, 100, 100),
                new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilDate, Order.BuyOrSell.Sell, 110, 100)
            };
        }
Пример #4
0
        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 void Init()
 {
     m_Instrument = new Instrument("MSFT");
     m_Trades = new Trades(m_Instrument);
 }
Пример #6
0
 public OrderBook(int instrument, BuyOrders buyOrders, SellOrders sellOrders, Trades trades)
     : this(
         instrument, buyOrders, sellOrders, trades, new SynchronousOrderProcessor(buyOrders, sellOrders, trades))
 {
 }
Пример #7
0
        public OrderBook(int instrument, BuyOrders buyOrders, SellOrders sellOrders, Trades trades)
            : this(
                instrument, buyOrders, sellOrders, trades, new SynchronousOrderProcessor(buyOrders, sellOrders, trades))
        {

        }
Пример #8
0
        public OrderBook(Instrument 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();
        }
Пример #9
0
 public void Init()
 {
     m_Instrument = 1;
     m_Trades = new Trades(m_Instrument);
 }