From c12d08ffcc10a237453f2a9e63f43320d4f928bc Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 31 Aug 2017 17:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0XTP=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=B0run.py=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/VnTrader/XTP_connect.json | 10 ++++++++++ examples/VnTrader/run.py | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 examples/VnTrader/XTP_connect.json diff --git a/examples/VnTrader/XTP_connect.json b/examples/VnTrader/XTP_connect.json new file mode 100644 index 00000000..ac5ba378 --- /dev/null +++ b/examples/VnTrader/XTP_connect.json @@ -0,0 +1,10 @@ +{ + "userID": "请联系中泰证券申请", + "password": "请联系中泰证券申请", + "clientID": 1, + "softwareKey": "请联系中泰证券申请", + "tdAddress": "120.27.164.69", + "tdPort": 6001, + "mdAddress": "120.27.164.138", + "mdPort": 6002 +} diff --git a/examples/VnTrader/run.py b/examples/VnTrader/run.py index 179a1edb..3199ce23 100644 --- a/examples/VnTrader/run.py +++ b/examples/VnTrader/run.py @@ -22,6 +22,9 @@ from vnpy.trader.gateway import (ctpGateway, oandaGateway, ibGateway, if system == 'Windows': from vnpy.trader.gateway import (femasGateway, xspeedGateway, sgitGateway, shzdGateway) + +if system == 'Linux': + from vnpy.trader.gateway import xtpGateway # 加载上层应用 from vnpy.trader.app import (riskManager, ctaStrategy, spreadTrading) @@ -52,6 +55,9 @@ def main(): me.addGateway(sgitGateway) me.addGateway(shzdGateway) + if system == 'Linux': + me.addGateway(xtpGateway) + # 添加上层应用 me.addApp(riskManager) me.addApp(ctaStrategy)