From 828d4eca7e205499a58d97633e146a827366832c Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 15 Jul 2017 18:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86Linux?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/VnTrader/run.py | 23 ++++++++++++++++------- vnpy/api/ctp/build.sh | 4 ++-- vnpy/api/ib/build.sh | 1 + vnpy/api/lts/build.sh | 6 +++--- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/examples/VnTrader/run.py b/examples/VnTrader/run.py index 0af7dabe..28aadddf 100644 --- a/examples/VnTrader/run.py +++ b/examples/VnTrader/run.py @@ -5,6 +5,10 @@ import sys reload(sys) sys.setdefaultencoding('utf8') +# 判断操作系统 +import platform +system = platform.system() + # vn.trader模块 from vnpy.event import EventEngine from vnpy.trader.vtEngine import MainEngine @@ -12,9 +16,12 @@ from vnpy.trader.uiQt import qApp from vnpy.trader.uiMainWindow import MainWindow # 加载底层接口 -from vnpy.trader.gateway import (ctpGateway, femasGateway, xspeedGateway, - sgitGateway, oandaGateway, ibGateway, - shzdGateway, huobiGateway, okcoinGateway) +from vnpy.trader.gateway import (ctpGateway, oandaGateway, ibGateway, + huobiGateway, okcoinGateway) + +if system == 'Windows': + from vnpy.trader.gateway import (femasGateway, xspeedGateway, + sgitGateway, shzdGateway) # 加载上层应用 from vnpy.trader.app import (riskManager, ctaStrategy, spreadTrading) @@ -31,15 +38,17 @@ def main(): # 添加交易接口 me.addGateway(ctpGateway) - me.addGateway(femasGateway) - me.addGateway(xspeedGateway) - me.addGateway(sgitGateway) me.addGateway(oandaGateway) me.addGateway(ibGateway) - me.addGateway(shzdGateway) me.addGateway(huobiGateway) me.addGateway(okcoinGateway) + if system == 'Windows': + me.addGateway(femasGateway) + me.addGateway(xspeedGateway) + me.addGateway(sgitGateway) + me.addGateway(shzdGateway) + # 添加上层应用 me.addApp(riskManager) me.addApp(ctaStrategy) diff --git a/vnpy/api/ctp/build.sh b/vnpy/api/ctp/build.sh index 8974b5fc..b5b756da 100644 --- a/vnpy/api/ctp/build.sh +++ b/vnpy/api/ctp/build.sh @@ -12,6 +12,6 @@ cmake .. make VERBOSE=1 -j 1 ln -fs `pwd`/lib/vnctpmd.so ../vnctpmd/test/vnctpmd.so ln -fs `pwd`/lib/vnctptd.so ../vnctptd/test/vnctptd.so -cp ../vnctpmd/test/vnctpmd.* ./ -cp ../vnctptd/test/vnctptd.* ./ +cp ../vnctpmd/test/vnctpmd.* ../ +cp ../vnctptd/test/vnctptd.* ../ popd diff --git a/vnpy/api/ib/build.sh b/vnpy/api/ib/build.sh index b9b36994..70da0d36 100644 --- a/vnpy/api/ib/build.sh +++ b/vnpy/api/ib/build.sh @@ -15,4 +15,5 @@ popd pushd $BUILDDIR cmake .. make VERBOSE=1 -j 1 +cp ./lib/vnib.* ../ popd diff --git a/vnpy/api/lts/build.sh b/vnpy/api/lts/build.sh index 61c5712f..01d1f26c 100644 --- a/vnpy/api/lts/build.sh +++ b/vnpy/api/lts/build.sh @@ -13,7 +13,7 @@ make VERBOSE=1 -j 1 ln -fs `pwd`/lib/vnltsmd.so ../vnltsmd/test/vnltsmd.so ln -fs `pwd`/lib/vnltstd.so ../vnltstd/test/vnltstd.so ln -fs `pwd`/lib/vnltsqry.so ../vnltsqry/test/vnltsqry.so -cp ../vnltsmd/test/vnltsmd.* ./ -cp ../vnltstd/test/vnltstd.* ./ -cp ../vnltsqry/test/vnltsqry.* ./ +cp ../vnltsmd/test/vnltsmd.* ../ +cp ../vnltstd/test/vnltstd.* ../ +cp ../vnltsqry/test/vnltsqry.* ../ popd