Ejemplo n.º 1
0
 public OrdersService()
 {
     bitfinexPublicApi = new BitfinexPublicApi();
     bitstampPublicApi = new BitstampPublicApi();
     lastDataOrderBook = new LastDataOrderBook();
     //Console.Write(bit.GetTicker("BTCUSD"));
 }
Ejemplo n.º 2
0
 private void GetOrderBookByTicker(IPublicApi publicApi, string ticker)
 {
     publicApi.GetOrderBook(ticker);
     lastDataOrderBook = publicApi.Get25dataFromOrderBook();
     Console.WriteLine("Provider:" + lastDataOrderBook.Provider + " " + lastDataOrderBook.AssetName + " Bid:" + lastDataOrderBook.bids.price + " Amount:" + lastDataOrderBook.bids.amount + " Timestamp:" + Utils.UnixTimeStampToDateTime(double.Parse(lastDataOrderBook.bids.timestamp)));
     Console.WriteLine("Provider:" + lastDataOrderBook.Provider + " " + lastDataOrderBook.AssetName + " Ask:" + lastDataOrderBook.asks.price + " Amount:" + lastDataOrderBook.asks.amount + " Timestamp:" + Utils.UnixTimeStampToDateTime(double.Parse(lastDataOrderBook.bids.timestamp)));
 }
Ejemplo n.º 3
0
        public LastDataOrderBook Get25dataFromOrderBook()
        {
            LastDataOrderBook lastDataOrderBook = new LastDataOrderBook();

            lastDataOrderBook.Provider       = "Bitfinex";
            lastDataOrderBook.AssetName      = assetOrder;
            lastDataOrderBook.asks.price     = _orderBook.asks[COUNT_ROW].price;
            lastDataOrderBook.asks.amount    = _orderBook.asks[COUNT_ROW].amount;
            lastDataOrderBook.asks.timestamp = _orderBook.asks[COUNT_ROW].timestamp;
            lastDataOrderBook.bids.price     = _orderBook.bids[COUNT_ROW].price;
            lastDataOrderBook.bids.amount    = _orderBook.bids[COUNT_ROW].amount;
            lastDataOrderBook.bids.timestamp = _orderBook.bids[COUNT_ROW].timestamp;

            return(lastDataOrderBook);
        }
        public LastDataOrderBook Get25dataFromOrderBook()
        {
            LastDataOrderBook lastDataOrderBook = new LastDataOrderBook();

            lastDataOrderBook.Provider       = "Bitstamp";
            lastDataOrderBook.AssetName      = assetOrder;
            lastDataOrderBook.asks.price     = orderBookBitstamp.asks[COUNT_ROW][0];
            lastDataOrderBook.asks.amount    = orderBookBitstamp.asks[COUNT_ROW][1];
            lastDataOrderBook.asks.timestamp = orderBookBitstamp.timestamp;
            lastDataOrderBook.bids.price     = orderBookBitstamp.bids[COUNT_ROW][0];
            lastDataOrderBook.bids.amount    = orderBookBitstamp.bids[COUNT_ROW][1];
            lastDataOrderBook.bids.timestamp = orderBookBitstamp.timestamp;

            return(lastDataOrderBook);
        }