JKorf / HTX.Net

A C# .netstandard client library for the Huobi REST and Websocket Spot and Swap API focusing on clear usage and models
https://jkorf.github.io/HTX.Net/
MIT License
73 stars 53 forks source link

How to restrict depth of range in GetKlinesAsync ? #114

Closed DenisNet123 closed 3 months ago

DenisNet123 commented 3 months ago

Good time of day. How to restrict depth of range in GetKlinesAsync ?

//Создаем клиента var restClient3 = new HuobiRestClient(); //Задаем интервал TimeSpan klInterval = new TimeSpan(0, 1, 0); //hour minutes seconds //Запрашиваем данные свечей var r = restClient3.SpotApi.CommonSpotClient .GetKlinesAsync("CLOSEDAIUSDT", klInterval).Result;

if (r.Success) { int i = 0;

            foreach (var p in r.Data)
            {
                //Выводим значение
                textBox1.AppendText("(" + i + " )" + " time= " + p.OpenTime.ToString() + " CloseVal= " + p.ClosePrice.ToString() + "\n");
                i++;
            }

        }

As a result I've got 500 values. If I need less (10 for example) Is this possible ? In huobi.sdk this API has parameter size. Your wrapper not accepted this ?

PS I can't find normal documentation. I studying it by your comments in code.

PPS I'm not freebie. I transferred 10 USDT. Время обработки2024-07-18 09:52:00 Комиссия1 Адрес вывода средств TKigKeJPXZYyMVDgMyXxMf17MWYia92Rjd Копировать TxID 1f9b15e575c010de8b9e3e2b1de34029ce366e26938c0c39f1facba9d8f040ee Копировать Тип цепиTRC20

JKorf commented 3 months ago

Hi, you're using the CommonSpotClient, which is client which offers some common functionality with other exchanges, but not the full API. You can use SpotApi.Exchange.Data.GetKlinesAsync instead.

DenisNet123 commented 3 months ago

Hi, you're using the CommonSpotClient, which is client which offers some common functionality with other exchanges, but not the full API. You can use SpotApi.Exchange.Data.GetKlinesAsync instead.

Much better, thank you.