예제 #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
예제 #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)
예제 #3
0
    def __init__(self):
        """Constructor"""
        # 创建事件引擎
        self.eventEngine = EventEngine2()
        self.eventEngine.start()

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

        # MongoDB数据库相关
        self.dbClient = None  # MongoDB客户端对象

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

        # 扩展模块
        self.ctaEngine = CtaEngine(self, self.eventEngine)  # cta策略运行模块
        self.drEngine = DrEngine(self, self.eventEngine)  # 数据记录模块
        self.rmEngine = RmEngine(self, self.eventEngine)  # 风险管理模块