From 07fcb9f64793cb4f277581058e879a92d6fc06a4 Mon Sep 17 00:00:00 2001 From: wisfern Date: Mon, 7 Aug 2017 13:39:55 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=BAgit=E5=BF=BD=E7=95=A5=E6=8E=89.vsc?= =?UTF-8?q?ode=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2601a9f6..0c5cb077 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ Release/ vn.ctp/build/* vn.lts/build/* .idea +.vscode .gitignore vn.trader/ctaAlgo/data/* From 8c9c126bb980f9932fbf3b80b69ed95e8683b6d4 Mon Sep 17 00:00:00 2001 From: wisfern Date: Thu, 10 Aug 2017 17:13:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?bugfix:=20=E8=A1=A5=E9=BD=90=E9=93=BE?= =?UTF-8?q?=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=B8=AD=E6=AF=AB=E7=A7=92=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/lhangGateway/lhangGateway.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vnpy/trader/gateway/lhangGateway/lhangGateway.py b/vnpy/trader/gateway/lhangGateway/lhangGateway.py index 174906e6..8e43d84d 100644 --- a/vnpy/trader/gateway/lhangGateway/lhangGateway.py +++ b/vnpy/trader/gateway/lhangGateway/lhangGateway.py @@ -180,7 +180,7 @@ class LhangApi(LhangApi): err = VtErrorData() err.gatewayName = self.gatewayName err.errorMsg = str(error) - err.errorTime = datetime.now().strftime('%H:%M:%S') + err.errorTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onError(err) #---------------------------------------------------------------------- @@ -236,7 +236,7 @@ class LhangApi(LhangApi): tick.askPrice5, tick.askVolume5 = data['asks'][4] now = datetime.now() - tick.time = now.strftime('%H:%M:%S') + tick.time = now.strftime('%H:%M:%S.%f')[:-3] tick.date = now.strftime('%Y%m%d') self.gateway.onTick(tick) @@ -356,7 +356,7 @@ class LhangApi(LhangApi): trade.direction = order.direction trade.offset = order.offset trade.exchange = order.exchange - trade.tradeTime = datetime.now().strftime('%H:%M:%S') + trade.tradeTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onTrade(trade) @@ -447,7 +447,7 @@ class LhangApi(LhangApi): err = VtErrorData() err.gatewayName = self.gatewayName err.errorMsg = u'链行接口仅支持限价单' - err.errorTime = datetime.now().strftime('%H:%M:%S') + err.errorTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] self.gateway.onError(err) return None @@ -480,7 +480,7 @@ class LhangApi(LhangApi): order.offset = OFFSET_UNKNOWN order.price = req.price order.volume = req.volume - order.orderTime = datetime.now().strftime('%H:%M:%S') + order.orderTime = datetime.now().strftime('%H:%M:%S.%f')[:-3] order.status = STATUS_UNKNOWN self.workingOrderDict[localID] = order From 78d628fac07d6aea32e5b45d3b651485206b219d Mon Sep 17 00:00:00 2001 From: ujfjhz Date: Fri, 11 Aug 2017 16:35:32 +0800 Subject: [PATCH 3/4] shcifco data api: use natural day instead of trading day --- vnpy/data/shcifco/vnshcifco.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vnpy/data/shcifco/vnshcifco.py b/vnpy/data/shcifco/vnshcifco.py index d72ded9a..34ae549d 100644 --- a/vnpy/data/shcifco/vnshcifco.py +++ b/vnpy/data/shcifco/vnshcifco.py @@ -132,14 +132,15 @@ class ShcifcoApi(object): barData = barStr.split(',') d = { 'symbol': barData[0], - 'date': barData[1], + # 'date': barData[1], # trading day 'time': barData[2], 'open': float(barData[3]), 'high': float(barData[4]), 'low': float(barData[5]), 'close': float(barData[6]), 'volume': int(barData[7]), - 'openInterest': int(barData[8]) + 'openInterest': int(barData[8]), + 'date': barData[9] # natural day } barList.append(d) From 5b2a6d06eab7c0f21d2eb5250e5f484e3e7e3b4d Mon Sep 17 00:00:00 2001 From: wisfern Date: Fri, 18 Aug 2017 09:53:30 +0800 Subject: [PATCH 4/4] =?UTF-8?q?bugfix:=20=E6=95=B0=E6=8D=AE=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E6=8E=92=E9=99=A4=E6=8B=92=E5=8D=95=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtEngine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index ab52c066..dc7a9a2f 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -350,7 +350,7 @@ class DataEngine(object): self.orderDict[order.vtOrderID] = order # 如果订单的状态是全部成交或者撤销,则需要从workingOrderDict中移除 - if order.status == STATUS_ALLTRADED or order.status == STATUS_CANCELLED: + if order.status in [STATUS_ALLTRADED, STATUS_REJECTED, STATUS_CANCELLED]: if order.vtOrderID in self.workingOrderDict: del self.workingOrderDict[order.vtOrderID] # 否则则更新字典中的数据