Open sguryev opened 6 years ago
@sguryev, thanks for reporting the exception. I have asked if the data is valid on the official API Telegram. Although, I can't imagine what a negative volume would represent if it is valid data.
@sonvister absolutely agree with you. I'm getting a bunch of symbols for 1M using Task.WhenAll()
and now have to make a tricky Task.Run()
workaround in order to swallow the exception. We can point them to the specific API call and ask about this negative value though
UPDATE: The query (https://api.binance.com/api/v1/klines?symbol=TRXBTC&interval=1M) still returns a negative volume....
https://github.com/sonvister/Binance/blob/da2967a181212fda937a28ed6fcdd284f0778966/src/Binance/Market/Candlestick.cs#L134 Reprosteps:
await _binanceApi.GetCandlesticksAsync("TRXBTC", CandlestickInterval.Month);
Json:Inner exception:
Candlestick: volume must not be less than 0. Parameter name: volume
StackTrace: at Binance.Candlestick..ctor(String symbol, CandlestickInterval interval, DateTime openTime, Decimal open, Decimal high, Decimal low, Decimal close, Decimal volume, DateTime closeTime, Decimal quoteAssetVolume, Int64 numberOfTrades, Decimal takerBuyBaseAssetVolume, Decimal takerBuyQuoteAssetVolume) at Binance.Serialization.CandlestickSerializer.<>c__DisplayClass14_0.b0(JToken item)
at System.Linq.Enumerable.SelectIListIteratord 26.MoveNext()
2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) at Binance.BinanceApi.