Closed Lxtluck closed 4 years ago
在huobi_future_api.py中添加如下代码 async def get_klines(self, symbol=None,period=None,size=None):
uri = "market/history/kline"
body = {}
if symbol:
body["symbol"] = symbol
if period:
body["period"] = period
if size:
body["size"] = size
success, error = await self.request("get", uri, body=body, auth=True)
return success, error
报错信息如下: [MyStrategy] Get swap market index faild: {'err-code': 'invalid-method', 'err-msg': 'not supported msg', 'status': 'error', 'ts': 1597132337579}
async def get_klines(self, symbol=None,period=None,size=None):
uri = "market/history/kline"
params = {}
if symbol:
params["symbol"] = symbol
if period:
params["period"] = period
if size:
params["size"] = size
success, error = await self.request("get", uri, params=params)
return success, error