取消不使用的交易接口
This commit is contained in:
parent
4e9026be8b
commit
2075fe9866
@ -14,6 +14,7 @@ from ctaAlgo.ctaEngine import CtaEngine
|
|||||||
from dataRecorder.drEngine import DrEngine
|
from dataRecorder.drEngine import DrEngine
|
||||||
from riskManager.rmEngine import RmEngine
|
from riskManager.rmEngine import RmEngine
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
class MainEngine(object):
|
class MainEngine(object):
|
||||||
@ -62,7 +63,8 @@ class MainEngine(object):
|
|||||||
self.gatewayDict['CTP_EBF'].setQryEnabled(True)
|
self.gatewayDict['CTP_EBF'].setQryEnabled(True)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
from ltsGateway.ltsGateway import LtsGateway
|
from ltsGateway.ltsGateway import LtsGateway
|
||||||
self.addGateway(LtsGateway, 'LTS')
|
self.addGateway(LtsGateway, 'LTS')
|
||||||
@ -123,7 +125,7 @@ class MainEngine(object):
|
|||||||
self.gatewayDict['OANDA'].setQryEnabled(True)
|
self.gatewayDict['OANDA'].setQryEnabled(True)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
"""
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
def addGateway(self, gateway, gatewayName=None):
|
def addGateway(self, gateway, gatewayName=None):
|
||||||
"""创建接口"""
|
"""创建接口"""
|
||||||
@ -207,8 +209,11 @@ class MainEngine(object):
|
|||||||
log.logContent = content
|
log.logContent = content
|
||||||
event = Event(type_=EVENT_LOG)
|
event = Event(type_=EVENT_LOG)
|
||||||
event.dict_['data'] = log
|
event.dict_['data'] = log
|
||||||
self.eventEngine.put(event)
|
self.eventEngine.put(event)
|
||||||
|
|
||||||
|
# 写入本地log日志
|
||||||
|
logging.info(content)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
def dbConnect(self):
|
def dbConnect(self):
|
||||||
"""连接MongoDB数据库"""
|
"""连接MongoDB数据库"""
|
||||||
|
@ -92,7 +92,11 @@ class VtGateway(object):
|
|||||||
# 通用事件
|
# 通用事件
|
||||||
event1 = Event(type_=EVENT_ERROR)
|
event1 = Event(type_=EVENT_ERROR)
|
||||||
event1.dict_['data'] = 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):
|
def onLog(self, log):
|
||||||
@ -102,7 +106,7 @@ class VtGateway(object):
|
|||||||
event1.dict_['data'] = log
|
event1.dict_['data'] = log
|
||||||
self.eventEngine.put(event1)
|
self.eventEngine.put(event1)
|
||||||
|
|
||||||
# 写入本地log日志
|
# 写入本地log日志
|
||||||
logging.info(log.logContent)
|
logging.info(log.logContent)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user