From cb54d52e86707d92e5eb8cee589016ae2a6831d2 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 23 May 2019 09:42:57 +0800 Subject: [PATCH] [Mod] flake8 code quanlity improve --- tests/trader/run.py | 26 +++++++++++++------------- vnpy/gateway/xtp/xtp_gateway.py | 3 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/trader/run.py b/tests/trader/run.py index 610e6f7d..b06b4af4 100644 --- a/tests/trader/run.py +++ b/tests/trader/run.py @@ -35,20 +35,20 @@ def main(): main_engine = MainEngine(event_engine) main_engine.add_gateway(XtpGateway) - # main_engine.add_gateway(CtpGateway) + main_engine.add_gateway(CtpGateway) # main_engine.add_gateway(CtptestGateway) - # main_engine.add_gateway(FemasGateway) - # main_engine.add_gateway(IbGateway) - # main_engine.add_gateway(FutuGateway) - # main_engine.add_gateway(BitmexGateway) - # main_engine.add_gateway(TigerGateway) - # main_engine.add_gateway(OesGateway) - # main_engine.add_gateway(OkexGateway) - # main_engine.add_gateway(HuobiGateway) - # main_engine.add_gateway(BitfinexGateway) - # main_engine.add_gateway(OnetokenGateway) - # main_engine.add_gateway(OkexfGateway) - # main_engine.add_gateway(HbdmGateway) + main_engine.add_gateway(FemasGateway) + main_engine.add_gateway(IbGateway) + main_engine.add_gateway(FutuGateway) + main_engine.add_gateway(BitmexGateway) + main_engine.add_gateway(TigerGateway) + main_engine.add_gateway(OesGateway) + main_engine.add_gateway(OkexGateway) + main_engine.add_gateway(HuobiGateway) + main_engine.add_gateway(BitfinexGateway) + main_engine.add_gateway(OnetokenGateway) + main_engine.add_gateway(OkexfGateway) + main_engine.add_gateway(HbdmGateway) main_engine.add_app(CtaStrategyApp) main_engine.add_app(CtaBacktesterApp) diff --git a/vnpy/gateway/xtp/xtp_gateway.py b/vnpy/gateway/xtp/xtp_gateway.py index 9a66f309..4c3fa492 100644 --- a/vnpy/gateway/xtp/xtp_gateway.py +++ b/vnpy/gateway/xtp/xtp_gateway.py @@ -654,7 +654,7 @@ class XtpTraderApi(API.TraderSpi): """""" self.check_error("ε§”ζ‰˜δΈ‹ε•", error_info) - direction, offset = DIRECTION_XTP2VT[ order_info.side] + direction, offset = DIRECTION_XTP2VT[order_info.side] order = OrderData( symbol=order_info.ticker, @@ -814,4 +814,3 @@ class XtpTraderApi(API.TraderSpi): self.gateway.on_position(position) self.short_positions.clear() -