Exemplo n.º 1
0
 public OrdersService()
 {
     // bitfinexPublicApi = new BitfinexPublicApi();
     bitstampPublicApi = new BitstampPublicApi();
     lastDataOrderBook = new LastDataOrderBook();
     //Console.Write(bit.GetTicker("BTCUSD"));
 }
 public void GetNdataFromOrderBook()
 {
     if (_orderBook != null)
     {
         lastDataOrderBook                = new LastDataOrderBook();
         lastDataOrderBook.Provider       = "Bitfinex";
         lastDataOrderBook.AssetName      = assetOrder;
         lastDataOrderBook.asks.price     = _orderBook.asks[Order_num - 1].price;
         lastDataOrderBook.asks.amount    = _orderBook.asks[Order_num - 1].amount;
         lastDataOrderBook.asks.timestamp = _orderBook.asks[Order_num - 1].timestamp;
         lastDataOrderBook.bids.price     = _orderBook.bids[Order_num - 1].price;
         lastDataOrderBook.bids.amount    = _orderBook.bids[Order_num - 1].amount;
         lastDataOrderBook.bids.timestamp = _orderBook.bids[Order_num - 1].timestamp;
     }
 }
 public void GetNdataFromOrderBook()
 {
     if (orderBookBitstamp != null)
     {
         lastDataOrderBook = new LastDataOrderBook
         {
             Provider  = "Bitstamp",
             AssetName = assetOrder
         };
         lastDataOrderBook.asks.price     = orderBookBitstamp.asks[Order_num - 1][0];
         lastDataOrderBook.asks.amount    = orderBookBitstamp.asks[Order_num - 1][1];
         lastDataOrderBook.asks.timestamp = orderBookBitstamp.timestamp;
         lastDataOrderBook.bids.price     = orderBookBitstamp.bids[Order_num - 1][0];
         lastDataOrderBook.bids.amount    = orderBookBitstamp.bids[Order_num - 1][1];
         lastDataOrderBook.bids.timestamp = orderBookBitstamp.timestamp;
     }
 }