Ejemplo n.º 1
0
        public ExchangePricesEventArgs(OkExOrderBook orderBook, string channel) : this()
        {
            var instruments = OkExTrade.ParseInstruments(channel, "_depth_");

            Instrument1 = instruments[0];
            Instrument2 = instruments[1];
            Exchange    = ExchangeName.OkEx;
            OrderBook   = new OrderBookEventArgs(orderBook).OrderBook;
        }
Ejemplo n.º 2
0
        public OrderBookEventArgs(OkExOrderBook orders, CurrencyName instrument2 = CurrencyName.Undefined) : this()
        {
            if (orders.Data.Timestamp > 0)
            {
                Timestamp = StartTime.AddMilliseconds(orders.Data.Timestamp);
            }

            OrderBook = new OrderBook();

            if (instrument2 != CurrencyName.Undefined)
            {
                Instrument2 = instrument2;
            }
            InitAsks(OrderBook, orders.Data.Asks);
            InitBids(OrderBook, orders.Data.Bids);
        }