取消不使用的交易接口

This commit is contained in:
msincenselee 2016-07-13 23:42:05 +08:00
parent 4e9026be8b
commit 2075fe9866
2 changed files with 15 additions and 6 deletions

View File

@ -14,6 +14,7 @@ from ctaAlgo.ctaEngine import CtaEngine
from dataRecorder.drEngine import DrEngine
from riskManager.rmEngine import RmEngine
import logging
########################################################################
class MainEngine(object):
@ -62,7 +63,8 @@ class MainEngine(object):
self.gatewayDict['CTP_EBF'].setQryEnabled(True)
except Exception, e:
print e
"""
try:
from ltsGateway.ltsGateway import LtsGateway
self.addGateway(LtsGateway, 'LTS')
@ -123,7 +125,7 @@ class MainEngine(object):
self.gatewayDict['OANDA'].setQryEnabled(True)
except Exception, e:
print e
"""
# ----------------------------------------------------------------------
def addGateway(self, gateway, gatewayName=None):
"""创建接口"""
@ -207,8 +209,11 @@ class MainEngine(object):
log.logContent = content
event = Event(type_=EVENT_LOG)
event.dict_['data'] = log
self.eventEngine.put(event)
self.eventEngine.put(event)
# 写入本地log日志
logging.info(content)
# ----------------------------------------------------------------------
def dbConnect(self):
"""连接MongoDB数据库"""

View File

@ -92,7 +92,11 @@ class VtGateway(object):
# 通用事件
event1 = Event(type_=EVENT_ERROR)
event1.dict_['data'] = error
self.eventEngine.put(event1)
self.eventEngine.put(event1)
logMsg = u'{0}:[{1}]:{2}'.format(error.gatewayName, error.errorID,error.errorMsg )
# 写入本地log日志
logging.info(logMsg)
# ----------------------------------------------------------------------
def onLog(self, log):
@ -102,7 +106,7 @@ class VtGateway(object):
event1.dict_['data'] = log
self.eventEngine.put(event1)
# 写入本地log日志
# 写入本地log日志
logging.info(log.logContent)