Closed Akunin88 closed 6 months ago
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);
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.
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);