HuobiRDCenter / huobi_Golang

Go SDK for Huobi Spot API
https://www.htx.com/zh-cn/opend/newApiPages/
Apache License 2.0
176 stars 86 forks source link

how to get Candlestick data in websocket #3

Closed titilami closed 4 years ago

titilami commented 4 years ago

when i ran "reqAndSubscribeCandlestick", in client.SetHandler() para is: client.Request("btcusdt", "4hour", 1569361140, 1600988820, "2305") client.Subscribe("btcusdt", "4hour", "2118")

but i can't get "Candlestick data, id: xxxxxx" in stdout. the stdout only contains "Candlestick update, id: xxxxx" data. thx.

eynzhang commented 4 years ago

@titilami , the API document explained the reason for that, "pull request is supported with extra parameters to define the range. The maximum number of ticks in each response is 300.” https://huobiapi.github.io/docs/spot/v1/en/#market-candlestick

Therefore your “from” and “to” parameters should be updated to make the time window smaller.