| | |
| | | @return: |
| | | """ |
| | | # 60个交易日未涨停取 |
| | | k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | has_limit_up_in_60 = True |
| | | if k_format and not k_format[13]: |
| | | has_limit_up_in_60 = False |
| | | volume = self.get_max_volume_in_5days(code) |
| | | if volume and volume * limit_up_price >= 9e8 and has_limit_up_in_60: |
| | | return volume |
| | | # k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | # has_limit_up_in_60 = True |
| | | # if k_format and not k_format[13]: |
| | | # has_limit_up_in_60 = False |
| | | # volume = self.get_max_volume_in_5days(code) |
| | | # if volume and volume * limit_up_price >= 9e8 and has_limit_up_in_60: |
| | | # return volume |
| | | return int(self.get_reference_volume_as_money_y(code) * 1e8 / limit_up_price) |
| | | |
| | | def get_radical_buy_refer_volume_info(self, code, limit_up_price): |
| | |
| | | @return: |
| | | """ |
| | | # 60个交易日未涨停取 |
| | | k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | has_limit_up_in_60 = True |
| | | if k_format and not k_format[13]: |
| | | has_limit_up_in_60 = False |
| | | # k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | # has_limit_up_in_60 = True |
| | | # if k_format and not k_format[13]: |
| | | # has_limit_up_in_60 = False |
| | | # (量, 日期) |
| | | volume_info = self.__max_volume_info_in_5days.get(code, None) |
| | | if volume_info and volume_info[0] * limit_up_price >= 9e8 and has_limit_up_in_60: |
| | | return volume_info |
| | | # volume_info = self.__max_volume_info_in_5days.get(code, None) |
| | | # if volume_info and volume_info[0] * limit_up_price >= 9e8 and has_limit_up_in_60: |
| | | # return volume_info |
| | | return self.get_reference_volume_info(code) |
| | | |
| | | def get_volume_rate_refer_in_5days(self, code, total_sell_volume=0): |
| | |
| | | max_volume = self.get_max_volume_in_5days(code) |
| | | if not max_volume: |
| | | return 0 |
| | | today_volume = self.get_today_volumn(code) |
| | | today_volume = self.get_today_volumn_cache(code) |
| | | return round((today_volume + total_sell_volume) / max_volume, 2) |
| | | |
| | | # 获取历史量 |
| | |
| | | _volumn = global_util.today_volumn.get(code) |
| | | if _volumn is None: |
| | | _volumn = RedisUtils.get(self.__redis_manager.getRedis(), "volumn_today-{}".format(code)) |
| | | if not _volumn: |
| | | _volumn = 0 |
| | | return int(_volumn) |
| | | |
| | | # 获取今日量 |
| | | def get_today_volumn_cache(self, code): |
| | | return global_util.today_volumn.get(code) |
| | | if code in global_util.today_volumn: |
| | | return global_util.today_volumn.get(code) |
| | | return 0 |
| | | |
| | | # 获取量比(今日量/max(60天最大量,昨日量)) |
| | | # 将总卖量计算在内 |
| | | def get_volume_rate(self, code, total_sell_volume=0, with_info=False): |
| | | today = self.get_today_volumn(code) |
| | | today = self.get_today_volumn_cache(code) |
| | | max60, yesterday = self.get_histry_volumn(code) |
| | | if today is None: |
| | | today = 0 |