[Mod]HuobiGateway只查询现货交易账户信息

This commit is contained in:
vn.py 2018-06-10 16:03:31 +08:00
parent 8cdfcef62b
commit a80f44100f

View File

@ -84,7 +84,7 @@ class HuobiGateway(VtGateway):
# 创建行情和交易接口对象 # 创建行情和交易接口对象
self.dataApi.connect(exchange, symbols) self.dataApi.connect(exchange, symbols)
self.tradeApi.connect(exchange, accessKey, secretKey, symbols) self.tradeApi.connect(exchange, symbols, accessKey, secretKey)
# 初始化并启动查询 # 初始化并启动查询
self.initQuery() self.initQuery()
@ -495,8 +495,9 @@ class HuobiTradeApi(TradeApi):
def onGetAccounts(self, data, reqid): def onGetAccounts(self, data, reqid):
"""查询账户回调""" """查询账户回调"""
for d in data: for d in data:
self.accountid = str(d['id']) if str(d['type']) == 'spot':
self.writeLog(u'交易账户%s查询成功' %self.accountid) self.accountid = str(d['id'])
self.writeLog(u'交易账户%s查询成功' %self.accountid)
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def onGetAccountBalance(self, data, reqid): def onGetAccountBalance(self, data, reqid):