From c2b96c0444fadb8e5371b802f6f7d1309bd37dbd Mon Sep 17 00:00:00 2001 From: Zedan Tan Date: Mon, 8 Jan 2018 12:23:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=B5=B7=E4=B8=AD=E6=9C=9F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 端口更改 2. 路劲更改 3. 持仓量str->float->int --- examples/ShcifcoDataService/config.json | 2 +- vnpy/data/shcifco/vnshcifco.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/ShcifcoDataService/config.json b/examples/ShcifcoDataService/config.json index 7523143f..6f1e00a3 100644 --- a/examples/ShcifcoDataService/config.json +++ b/examples/ShcifcoDataService/config.json @@ -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", diff --git a/vnpy/data/shcifco/vnshcifco.py b/vnpy/data/shcifco/vnshcifco.py index 34ae549d..e7ace167 100644 --- a/vnpy/data/shcifco/vnshcifco.py +++ b/vnpy/data/shcifco/vnshcifco.py @@ -22,8 +22,8 @@ class ShcifcoApi(object): self.ip = ip 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)