JKorf / OKX.Net

A C# .netstandard client library for the OKX REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/OKX.Net/
MIT License
31 stars 15 forks source link

GetKlinesAsync request with custom dates return empty candles list #33

Closed Akunin88 closed 6 months ago

Akunin88 commented 6 months ago

1

DateTime startTime1 = DateTime.UtcNow.AddDays(-5); var request = await client.UnifiedApi.ExchangeData.GetKlinesAsync("BTC-USDT", OKX.Net.Enums.OKXPeriod.OneMinute, startTime1, startTime1.AddMinutes(200), limit: 300);

JKorf commented 6 months ago

The GetKlines endpoint only supports that last 1440 entries, so OneMinute klines 5 days ago is too far back. You can instead use the GetKlineHistoryAsync endpoint, though that has a max limit of 100 results.