Merge branch 'dev' of https://github.com/vnpy/vnpy into dev

This commit is contained in:
vn.py 2018-01-08 16:46:55 +08:00
commit 945c31fdde
2 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@
"MONGO_PORT": 27017,
"SHCIFCO_IP": "180.169.126.123",
"SHCIFCO_PORT": "45065",
"SHCIFCO_PORT": "10083",
"SHCIFCO_TOKEN": "请联系上海中期申请",
"SYMBOLS": ["cu1707", "cu1708", "cu1709", "cu1712",

View File

@ -23,7 +23,7 @@ class ShcifcoApi(object):
self.port = port
self.token = token
self.service = 'ShcifcoApi'
self.service = 'shcifco/dataapi'
self.domain = 'http://' + ':'.join([self.ip, self.port])
#----------------------------------------------------------------------
@ -59,7 +59,7 @@ class ShcifcoApi(object):
'askPrice': float(l[4]),
'askVolume': int(l[5]),
'volume': int(l[6]),
'openInterest': int(l[7])
'openInterest': int(float(l[7]))
}
return d
@ -97,14 +97,14 @@ class ShcifcoApi(object):
'low': float(l[4]),
'close': float(l[5]),
'volume': int(l[6]),
'openInterest': int(l[7])
'openInterest': int(float(l[7]))
}
return d
#----------------------------------------------------------------------
def getHisBar(self, symbol, num, date='', period=''):
"""获取历史K线数据"""
path = 'hisbar'
path = 'hisminbar'
# 默认参数
params = {
@ -139,7 +139,7 @@ class ShcifcoApi(object):
'low': float(barData[5]),
'close': float(barData[6]),
'volume': int(barData[7]),
'openInterest': int(barData[8]),
'openInterest': int(float(barData[8])),
'date': barData[9] # natural day
}
barList.append(d)