Ejemplo n.º 1
0
    def __init__(self, enableCtaEngine=True, enableDrEngine=True, enableRmEngine=True):
        """Constructor"""
        # 记录今日日期
        self.todayDate = datetime.now().strftime('%Y%m%d')
        
        # 创建事件引擎
        self.eventEngine = EventEngine2()
        self.eventEngine.start()
        
        # 创建数据引擎
        self.dataEngine = DataEngine(self.eventEngine)
        
        # MongoDB数据库相关
        self.dbClient = None    # MongoDB客户端对象
        
        # 调用一个个初始化函数
        self.initGateway()

        # 扩展模块
        if enableCtaEngine:
            self.ctaEngine = CtaEngine(self, self.eventEngine)
        else:
            self.ctaEngine = None

        if enableDrEngine:
            self.drEngine = DrEngine(self, self.eventEngine)
        else:
            self.drEngine = None

        if enableRmEngine:
            self.rmEngine = RmEngine(self, self.eventEngine)
        else:
            self.rmEngine = None
Ejemplo n.º 2
0
    def __init__(self, client, eventEngine):
        """Constructor"""
        self.client = client
        self.eventEngine = eventEngine

        # 扩展模块
        self.ctaEngine = CtaEngine(self, self.eventEngine)
        self.drEngine = DrEngine(self, self.eventEngine)
        self.rmEngine = RmEngine(self, self.eventEngine)
Ejemplo n.º 3
0
    def __init__(self):
        """Constructor"""
        # 记录今日日期
        self.todayDate = datetime.now().strftime('%Y%m%d')
        self.ctp_get_all_contract = False

        # 创建事件引擎
        self.eventEngine = EventEngine2()
        self.eventEngine.start()

        # 创建数据引擎
        self.dataEngine = DataEngine(self.eventEngine)

        # mysql本地数据库相关
        self.cnx = None  # mysql对象

        # 调用一个个初始化函数
        self.initGateway()

        # 扩展模块
        self.ctaEngine = CtaEngine(self, self.eventEngine)
Ejemplo n.º 4
0
 def ctaEngine(self):
     """ return ctaEngine """
     from ctaStrategy.ctaEngine import CtaEngine
     if self._ctaEngine == None:
         self._ctaEngine = CtaEngine(self, self.eventEngine)
     return self._ctaEngine