Closed allcasper99 closed 3 years ago
The following code (same as yours) is retrieving the last candle which is unfinished. That's why the data is different. It changes over the time until the time interval is complete.
await client.Spot.Market.GetKlinesAsync("ICXUSDT", KlineInterval.FourHour, limit: 1).ConfigureAwait(false);
If you want to pull the latest finished candle you should do:
await client.Spot.Market.GetKlinesAsync("ICXUSDT", KlineInterval.FourHour, limit: 2).ConfigureAwait(false).SkipLast(1).ToList();
Or you could just remove the last candle, instead of SkipLast
.
Hi.
await client.Spot.Market.GetKlinesAsync("ICXUSDT", KlineInterval.FourHour, limit: 2).ConfigureAwait(false).SkipLast(1).ToList();
Is SkipLast here obsolete anymore?
hello, when I use the klines method, there is a problem with the incoming prices. The prices of the Tradingview website and the binance exchange are the same, but the price from the method is different. You can see in the attachment. Example icxusdt
Binance
Tradingview
Binance.Net GetKlines
Can you fix this problem?