コード例 #1
0
    def is_trend_open_time(self):

        # the first 5 minute we don't to open
        hour = self._time.split(':')[0]
        hour = int(hour)
        minute = self._time.split(':')[1]
        minute = int(minute)
        if hour == 9 and minute < 5:
            return False

        is_time_open = self.is_time_open_time()
        if is_time_open == False:
            return False

        is_band_open = bf.is_band_open_time(self._direction, self._lastprice,
                                            self._now_middle_value_60,
                                            self._param_open_edge1,
                                            self._param_open_edge2)
        # return is_band_open
        if is_band_open == False:
            return False

        is_trigger_size_open = bf.is_trigger_size_open_time(
            self._direction, self._diff_volume, self._limit_diff_volume,
            self._spread, self._limit_spread)
        return is_trigger_size_open
コード例 #2
0
ファイル: md.py プロジェクト: songxiaoyuan/secondworkcode
    def is_trend_open_time(self):
        # "'this is used to jude the time used to open return bool'"
        # first base the sd,find is time to open band
        is_band_open = bf.is_band_open_time(self._direction, self._lastprice,
                                            self._now_middle_value,
                                            self._now_sd_val, self._open_edge1,
                                            self._open_edge2)
        # return is_band_open
        if is_band_open == False:
            return False

        is_diff_volume_open = bf.is_diff_volume_open_time(
            self._tmp_sum_diff_volume, self._diff_volume_array,
            self._limit_multiple, self._limit_large_period)

        # return is_diff_volume_open
        if is_diff_volume_open == False:
            return False

        # is_series_open = bf.is_lastprice_series_open_time(self._direction,self._series_lastprice,self._limit_series_lastprice)
        is_lastprice_open = bf.is_lastprice_open_time(self._direction,
                                                      self._lastprice,
                                                      self._lastprice_array,
                                                      self._limit_large_period)

        return is_lastprice_open
コード例 #3
0
 def is_trend_open_time(self):
     # "'this is used to jude the time used to open return bool'"
     open_val = self._param_open_edge1
     is_band_open = bf.is_band_open_time(self._direction,
                                         self._now_md_price[LASTPRICE],
                                         self._now_middle_value,
                                         self._now_sd_val,
                                         self._param_open_edge1,
                                         self._param_open_edge2)
     # return is_band_open
     if is_band_open == False:
         return False
     is_trigger_open = bf.is_trigger_size_open_time(
         self._direction, self._now_md_price, self._pre_md_price,
         self._param_volume_open_edge, self._param_open_interest_edge,
         self._param_spread, self._multiple)
     return is_trigger_open
コード例 #4
0
ファイル: md.py プロジェクト: songxiaoyuan/secondworkcode
    def is_trend_open_time(self):

        is_band_open = bf.is_band_open_time(self._direction, self._lastprice,
                                            self._now_middle_value,
                                            self._param_open_edge1,
                                            self._param_open_edge2)
        # return is_band_open
        if is_band_open == False:
            return False

        if self._diff_volume < self._param_volume_open_edge:
            return False
        if self._diff_openinterest != 0 and self._diff_openinterest < self._param_open_interest_edge:
            return False
        # return True
        if self._direction == LONG:
            if self._spread < self._param_spread:
                return False
        elif self._direction == SHORT:
            tmp = 100 - self._spread
            if tmp < self._param_spread:
                return False
        is_time_open = self.is_time_open_time()
        return is_time_open