gateio / WebSocket-API

gateio WebSocket-API
56 stars 32 forks source link

kline.query开始时间问题 (kline start time problem) #8

Closed paulluap closed 5 years ago

paulluap commented 5 years ago
gate.wsGet(Math.round(Math.random()*1000),'kline.query', ["BTC_USDT", 1, 1516951219, 1800]);

这里start 1和end 1516951219表示什么?

猜测1516951219应该是unix time,单位是,1肯定不是unix时间,那是什么意思?

我如果要得到过去24小时的 1min类型的 kline数据,应该传什么参数?

What do start 1 and 1516951219 mean here ?

I guess 1516951219 should be unix time in seconds (not in milliseconds as is the usual case), but then what does 1 mean ?

Say If I want to get the 1min kline data in the past 24 hours, what start and end values should be used ?

Doing this gets me invalid argument error:

gate.wsGet(Math.round(Math.random()*1000),'kline.query', ["BTC_USDT", 1566123086, 1566209456, 60]);

where 1566209456 is the time when I wrote this code and 1566123086 is 24hours ago.

Update:

我传的第一个参数传错了,用了毫秒,没有用秒

I found I used milliseconds in my own code, not seconds ... , but using 1 as the start time in the example is a little confusing, it is unlikely to mean getting all the kline data since 1970.