Example #1
0
    def initStrategyManager(self):
        """初始化策略管理组件界面"""
        w = QtGui.QWidget()
        vbox = QtGui.QVBoxLayout()

        for name in self.ctaEngine.strategyDict.keys():
            p = self.ctaEngine.strategyDict[name]
            if p.className == 'tradeTest':
                strategyManager = CtaStrategyManager(self.ctaEngine,
                                                     self.eventEngine, name,
                                                     p.className, '', '',
                                                     p.longsymbol,
                                                     p.shortsymbol)
            elif p.className == 'CtpAndIB':
                strategyManager = CtaStrategyManager(self.ctaEngine,
                                                     self.eventEngine, name,
                                                     p.className, '', '',
                                                     p.longsymbol,
                                                     p.shortsymbol)
            else:
                strategyManager = CtaStrategyManager(self.ctaEngine,
                                                     self.eventEngine, name,
                                                     p.className, p.direction,
                                                     p.vtSymbol, '', '')
            vbox.addWidget(strategyManager)

        vbox.addStretch()

        w.setLayout(vbox)
        self.scrollArea.setWidget(w)
Example #2
0
    def initStrategyManager(self):
        """初始化策略管理组件界面"""
        w = QtGui.QWidget()
        hbox = QtGui.QHBoxLayout()

        for name in self.ctaEngine.strategyDict.keys():
            strategyManager = CtaStrategyManager(self.ctaEngine,
                                                 self.eventEngine, name)
            hbox.addWidget(strategyManager)

        w.setLayout(hbox)
        self.scrollArea.setWidget(w)
Example #3
0
    def initStrategyManager(self):
        """初始化策略管理组件界面"""
        w = QtGui.QWidget()
        vbox = QtGui.QVBoxLayout()

        for name in self.chanlunEngine.strategyDict.keys():
            strategyManager = ChanlunStrategyManager(self.chanlunEngine,
                                                     self.eventEngine, name)
            vbox.addWidget(strategyManager)

        vbox.addStretch()

        w.setLayout(vbox)
        self.scrollArea.setWidget(w)
Example #4
0
 def initStrategyManager(self):
     """初始化策略管理组件界面"""        
     w = QtGui.QWidget()
     vbox = QtGui.QVBoxLayout()
     
     for name in self.ctaEngine.strategyDict.keys():
         # 为每一个策略实例,创建对应的管理组件实例
         strategyManager = CtaStrategyManager(self.ctaEngine, self.eventEngine, name)
         vbox.addWidget(strategyManager)
         sleep(0.2)
     
     vbox.addStretch()
     
     w.setLayout(vbox)
     self.scrollArea.setWidget(w)   
    def initStrategyManager(self):
        """初始化策略管理组件界面"""
        w = QtGui.QWidget()
        vbox = QtGui.QVBoxLayout()
        self.runID = 9999

        for name in self.stockBacktestEngine.strategyDict.keys():
            strategyManager = StockStrategyManager(self.stockBacktestEngine,
                                                   self.eventEngine, name,
                                                   self.runID)
            vbox.addWidget(strategyManager)
            self.runID -= 1

            self.signal2.connect(self.updateBktResult)
            self.eventEngine.register(EVENT_BKT_STRATEGY + name,
                                      self.signal2.emit)

        vbox.addStretch()

        w.setLayout(vbox)
        self.scrollArea.setWidget(w)