protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            // {"TradePairId":100,"Label":"DOT/BTC","Price":0.00000317,"Volume":333389.57231468,"Total":1.05684494}
            JToken token = await MakeJsonRequestAsync <JToken>("/GetMarketOrders/" + NormalizeSymbolForUrl(symbol) + "/" + maxCount.ToStringInvariant());

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "Sell", "Buy", "Price", "Volume", maxCount: maxCount));
        }
Пример #2
0
        protected internal override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            //"result" : { "buy" : [{"Quantity" : 4.99400000,"Rate" : 3.00650900}, {"Quantity" : 50.00000000, "Rate" : 3.50000000 }  ] ...
            JToken token = await MakeJsonRequestAsync <JToken>("/public/getorderbook?market=" + symbol + "&type=ALL&depth=" + maxCount);

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "sell", "buy", "Rate", "Quantity", maxCount: maxCount));
        }
Пример #3
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            symbol = NormalizeSymbol(symbol);
            JToken token = await MakeJsonRequestAsync <JToken>("public/getorderbook?market=" + symbol + "&type=both&limit_bids=" + maxCount + "&limit_asks=" + maxCount);

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "sell", "buy", "Rate", "Quantity", maxCount: maxCount));
        }
Пример #4
0
        protected internal override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            symbol = NormalizeSymbol(symbol);
            JToken obj = await MakeJsonRequestAsync <JToken>("/book/" + symbol + "?limit_bids=" + maxCount + "&limit_asks=" + maxCount);

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(obj, maxCount: maxCount));
        }
Пример #5
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            var token = await MakeJsonRequestAsync <JToken>("/orderbook?pair=" + NormalizeSymbolForUrl(symbol));

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "sell", "buy", "Rate",
                                                                              "Quantity", maxCount: maxCount));
        }
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            try
            {
                var token = await MakeJsonRequestAsync <JToken>(
                    "/public/getorderbook?market=" + NormalizeSymbolForUrl(symbol));

                return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "sell", "buy", "rate",
                                                                                  "quantity", maxCount: maxCount));
            }
            catch (AggregateException ae)
            {
                ae.Handle(ex => true);
            }
            catch (APIException ex)
            {
            }
            return(new ExchangeOrderBook());
        }
Пример #7
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string marketSymbol, int maxCount = 25)
        {
            // Bittrex API allowed values are [1, 25, 500], default is 25.
            if (maxCount > 100)
            {
                maxCount = 500;
            }
            else if (maxCount > 25 && maxCount <= 100)             // ExchangeSharp default.
            {
                maxCount = 25;
            }
            else if (maxCount > 1 && maxCount <= 25)
            {
                maxCount = 25;
            }
            else
            {
                maxCount = 1;
            }

            JToken token = await MakeJsonRequestAsync <JToken>("/markets/" + marketSymbol + "/orderbook" + "?depth=" + maxCount);

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "ask", "bid", "rate", "quantity", maxCount: maxCount));
        }
Пример #8
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            JToken token = await MakeJsonRequestAsync <JToken>("/public/orderbook/" + symbol + "?limit=" + maxCount.ToStringInvariant());

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, asks: "ask", bids: "bid", amount: "size", maxCount: maxCount));
        }
Пример #9
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string marketSymbol, int maxCount = 25)
        {
            JToken token = await MakeJsonRequestAsync <JToken>("/markets/" + marketSymbol + "/orderbook" + marketSymbol + "&depth=" + maxCount);

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(token, "ask", "bid", "rate", "quantity", maxCount: maxCount));
        }
Пример #10
0
        protected override async Task <ExchangeOrderBook> OnGetOrderBookAsync(string symbol, int maxCount = 100)
        {
            var data = await MakeRequestBithumbAsync(symbol, "/public/orderbook/$SYMBOL$");

            return(ExchangeAPIExtensions.ParseOrderBookFromJTokenDictionaries(data.Item1, amount: "quantity", sequence: "timestamp", maxCount: maxCount));
        }