diff --git a/vnpy/trader/language/chinese/constant.py b/vnpy/trader/language/chinese/constant.py index 1ee2bcd9..efbad2ba 100644 --- a/vnpy/trader/language/chinese/constant.py +++ b/vnpy/trader/language/chinese/constant.py @@ -1,6 +1,5 @@ # encoding: UTF-8 - # 方向常量 DIRECTION_NONE = u'无方向' DIRECTION_LONG = u'多' diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index a65350d8..c5cc8682 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -6,7 +6,6 @@ from collections import OrderedDict from pymongo import MongoClient from pymongo.errors import ConnectionFailure -from vnpy.trader.vtGlobal import globalSetting from vnpy.trader.language import text from vnpy.trader.app.ctaStrategy.ctaEngine import CtaEngine from vnpy.trader.app.dataRecorder.drEngine import DrEngine diff --git a/vnpy/trader/vtMain.py b/vnpy/trader/vtMain.py index 4de448d1..2b043ee1 100644 --- a/vnpy/trader/vtMain.py +++ b/vnpy/trader/vtMain.py @@ -1,15 +1,22 @@ # encoding: UTF-8 import sys +reload(sys) +sys.setdefaultencoding('utf8') + import os import ctypes import platform -import vtPath +# 将repostory的目录i,作为根目录,添加到系统环境中。 +root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..','..')) +sys.path.append(root_path) + +from vnpy.trader.vtPath import * from vnpy.trader.vtEngine import MainEngine from vnpy.trader.uiMainWindow import * # 加载底层接口 -from vnpy.trader.gateway import ctpGateway +from gateway import ctpGateway # 初始化的接口模块,以及其指定的名称,CTP是模块,value,是该模块下的多个连接配置文件,如 CTP_JR_connect.json init_gateway_names = {'CTP': ['CTP', 'CTP_Prod', 'CTP_Post', 'CTP_EBF', 'CTP_JR', 'CTP_JR2']}