diff --git a/vn.trader/gateway/ctpGateway/ctpGateway.py b/vn.trader/gateway/ctpGateway/ctpGateway.py index a2e12200..46a36057 100644 --- a/vn.trader/gateway/ctpGateway/ctpGateway.py +++ b/vn.trader/gateway/ctpGateway/ctpGateway.py @@ -7,7 +7,7 @@ vn.ctp的gateway接入 vtSymbol直接使用symbol ''' - +import vtGlobal import os import json from copy import copy @@ -98,9 +98,11 @@ class CtpGateway(VtGateway): def connect(self): """连接""" # 载入json文件 - fileName = self.gatewayName + '_connect.json' - path = os.path.abspath(os.path.dirname(__file__)) - fileName = os.path.join(path, fileName) + fileName = vtGlobal.VT_setting.get(self.gatewayName + '_connect') + if fileName is None: + fileName = self.gatewayName + '_connect.json' + path = os.path.abspath(os.path.dirname(__file__)) + fileName = os.path.join(path, fileName) try: f = file(fileName)