Beispiel #1
0
    def _histDaysForcedUpdate(self):
        if self._histDaysForcedUpdateAction.text() == '停止':
            self._mainEngine._info.print('停止股票(指数)历史日线数据强制更新...',
                                         DyLogData.ind)

            # change UI
            self._stopRunningMutexAction()

            event = DyEvent(DyEventType.stopUpdateStockHistDaysReq)
            self._mainEngine.eventEngine.put(event)

        else:  # 开始手动更新
            data = {}
            if DyDateDlg(data, self).exec_():
                self._mainEngine._info.print(
                    '开始股票(指数,基金)历史日线数据强制更新[{0}, {1}]...'.format(
                        data['startDate'], data['endDate']), DyLogData.ind)

                # change UI
                self._startRunningMutexAction(self._histDaysForcedUpdateAction)

                event = DyEvent(DyEventType.updateStockHistDays)
                event.data = data
                event.data['indicators'] = DyStockDataCommon.dayIndicators
                event.data['forced'] = True

                self._mainEngine.eventEngine.put(event)
    def _focusAnalysisAct(self):
        data = {}
        if not DyDateDlg(data).exec_():
            return

        event = DyEvent(DyEventType.plotReq)
        event.data =  data
        event.data['type'] = 'focusAnalysis'

        self._mainEngine.eventEngine.put(event)
    def _highLowDistAct(self):
        data = {}
        if not DyDateDlg(data).exec_():
            return

        event = DyEvent(DyEventType.plotReq)
        event.data =  data
        event.data['type'] = 'highLowDist'

        self._mainEngine.eventEngine.put(event)
    def _limitUpStatsAct(self):
        data = {}
        if not DyDateDlg(data).exec_():
            return

        event = DyEvent(DyEventType.plotReq)
        event.data =  data
        event.data['type'] = 'limitUpStats'

        self._mainEngine.eventEngine.put(event)
    def _stockRegression(self):
        strategyCls, param = self._widgetStrategy.getStrategy()
        if strategyCls is None: return

        data = {}
        if not DyDateDlg(data).exec_():
            return

        # change UI
        self._startRunningMutexAction(self._stockRegressionAction)

        event = DyEvent(DyEventType.stockSelectStrategyRegressionReq)
        event.data['class'] = strategyCls
        event.data['param'] = param
        event.data['startDate'] = data['startDate']
        event.data['endDate'] = data['endDate']

        self._mainEngine.eventEngine.put(event)
    def _indexConsecutiveDayLineStatsAct(self):
        if self._greenLineStatsAction.isChecked():
            greenLine = True
            self._greenLineStatsAction.setChecked(False)
        else:
            greenLine = False
            self._redLineStatsAction.setChecked(False)

        data = {}
        if not DyDateDlg(data).exec_():
            return

        event = DyEvent(DyEventType.plotReq)
        event.data =  data
        event.data['type'] = 'indexConsecutiveDayLineStats'
        event.data['greenLine'] = greenLine

        self._mainEngine.eventEngine.put(event)