Ejemplo n.º 1
0
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockTradeEventHandType.nbr)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info,
                                             False)

        # 实时行情监控
        self._stockMarketEngine = DyStockMarketEngine(self._eventEngine,
                                                      self._info)

        # 交易接口
        self._stockBrokerEngine = DyStockTradeBrokerEngine(
            self._eventEngine, self._info)

        # 策略CTA引擎
        self._stockCtaEngine = DyStockCtaEngine(self._dataEngine,
                                                self._eventEngine, self._info)

        # QQ消息
        #self._QQMsgEngine = DyStockTradeQQMsgEngine(self._eventEngine, self._info)

        # 微信
        # self._wxEngine = DyStockTradeWxEngine(self._eventEngine, self._info)

        # RPC
        #self._rpcEngine = DyStockTradeRpcEngine(self._eventEngine, self._info)

        self._eventEngine.start()
class DyStockBackTestingMainEngine(object):
    """ 股票回测主引擎 """

    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockBackTestingEventHandType.nbr, False)
        self._info = DyInfo(self._eventEngine)

        self._strategyEngine = DyStockBackTestingStrategyEngine(self._eventEngine, self._info)

        self._eventEngine.start()

    @property
    def eventEngine(self):
        return self._eventEngine

    @property
    def info(self):
        return self._info

    def exit(self):
        pass

    def setThreadMode(self):
        self._strategyEngine.setThreadMode(threadMode)

    def setProcessMode(self, mode):
        self._strategyEngine.setProcessMode(mode)
Ejemplo n.º 3
0
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockDataEventHandType.nbr, False)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info)

        self._eventEngine.start()
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockBackTestingEventHandType.nbr, False)
        self._info = DyInfo(self._eventEngine)

        self._strategyEngine = DyStockBackTestingStrategyEngine(self._eventEngine, self._info)

        self._eventEngine.start()
Ejemplo n.º 5
0
class DyStockDataMainEngine(object):
    """description of class"""

    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockDataEventHandType.nbr, False)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info)

        self._eventEngine.start()

    @property
    def eventEngine(self):
        return self._eventEngine

    @property
    def info(self):
        return self._info

    @property
    def dataEngine(self):
        return self._dataEngine

    def exit(self):
        pass
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockSelectEventHandType.nbr,
                                          False)
        self._info = DyInfo(self._eventEngine)

        self._selectEngine = DyStockSelectSelectEngine(self._eventEngine,
                                                       self._info)
        self._regressionEngine = DyStockSelectRegressionEngine(
            self._eventEngine, self._info)
        self._viewerEngine = DyStockSelectViewerEngine(self._eventEngine,
                                                       self._info)

        self._initDataViewer()

        self._eventEngine.start()
Ejemplo n.º 7
0
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockTradeEventHandType.nbr)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info, False)

        # 实时行情监控
        self._stockMarketEngine = DyStockMarketEngine(self._eventEngine, self._info)

        # 交易接口
        self._stockBrokerEngine = DyStockTradeBrokerEngine(self._eventEngine, self._info)

        # 策略CTA引擎
        self._stockCtaEngine = DyStockCtaEngine(self._dataEngine, self._eventEngine, self._info)

        # QQ消息
        #self._QQMsgEngine = DyStockTradeQQMsgEngine(self._eventEngine, self._info)

        # 微信
        self._wxEngine = DyStockTradeWxEngine(self._eventEngine, self._info)

        # RPC
        #self._rpcEngine = DyStockTradeRpcEngine(self._eventEngine, self._info)

        self._eventEngine.start()
Ejemplo n.º 8
0
class DyStockTradeMainEngine(object):
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockTradeEventHandType.nbr)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info,
                                             False)

        # 实时行情监控
        self._stockMarketEngine = DyStockMarketEngine(self._eventEngine,
                                                      self._info)

        # 交易接口
        self._stockBrokerEngine = DyStockTradeBrokerEngine(
            self._eventEngine, self._info)

        # 策略CTA引擎
        self._stockCtaEngine = DyStockCtaEngine(self._dataEngine,
                                                self._eventEngine, self._info)

        # QQ消息
        #self._QQMsgEngine = DyStockTradeQQMsgEngine(self._eventEngine, self._info)

        # 微信
        # self._wxEngine = DyStockTradeWxEngine(self._eventEngine, self._info)

        # RPC
        #self._rpcEngine = DyStockTradeRpcEngine(self._eventEngine, self._info)

        self._eventEngine.start()

    @property
    def eventEngine(self):
        return self._eventEngine

    @property
    def info(self):
        return self._info

    def exit(self):
        """退出程序前调用,保证正常退出"""
        # 停止事件引擎
        self._eventEngine.stop()
Ejemplo n.º 9
0
class DyStockTradeMainEngine(object):
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockTradeEventHandType.nbr)
        self._info = DyInfo(self._eventEngine)

        self._dataEngine = DyStockDataEngine(self._eventEngine, self._info, False)

        # 实时行情监控
        self._stockMarketEngine = DyStockMarketEngine(self._eventEngine, self._info)

        # 交易接口
        self._stockBrokerEngine = DyStockTradeBrokerEngine(self._eventEngine, self._info)

        # 策略CTA引擎
        self._stockCtaEngine = DyStockCtaEngine(self._dataEngine, self._eventEngine, self._info)

        # QQ消息
        #self._QQMsgEngine = DyStockTradeQQMsgEngine(self._eventEngine, self._info)

        # 微信
        self._wxEngine = DyStockTradeWxEngine(self._eventEngine, self._info)

        # RPC
        #self._rpcEngine = DyStockTradeRpcEngine(self._eventEngine, self._info)

        self._eventEngine.start()

    @property
    def eventEngine(self):
        return self._eventEngine

    @property
    def info(self):
        return self._info

    def exit(self):
        """退出程序前调用,保证正常退出"""        
        # 停止事件引擎
        self._eventEngine.stop()
class DyStockSelectMainEngine(object):
    def __init__(self):
        self._eventEngine = DyEventEngine(DyStockSelectEventHandType.nbr,
                                          False)
        self._info = DyInfo(self._eventEngine)

        self._selectEngine = DyStockSelectSelectEngine(self._eventEngine,
                                                       self._info)
        self._regressionEngine = DyStockSelectRegressionEngine(
            self._eventEngine, self._info)
        self._viewerEngine = DyStockSelectViewerEngine(self._eventEngine,
                                                       self._info)

        self._initDataViewer()

        self._eventEngine.start()

    @property
    def eventEngine(self):
        return self._eventEngine

    @property
    def info(self):
        return self._info

    def exit(self):
        pass

    def _initDataViewer(self):
        errorInfo = DyErrorInfo(self._eventEngine)
        dataEngine = DyStockDataEngine(self._eventEngine, errorInfo, False)
        self._dataViewer = DyStockDataViewer(dataEngine, errorInfo)

    @property
    def dataViewer(self):
        return self._dataViewer