| | |
| | | can_buy_result = CodePlateKeyBuyManager.can_buy(code) |
| | | if can_buy_result is None: |
| | | async_log_util.warning(logger_debug, "没有获取到板块缓存,将获取板块") |
| | | yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes() |
| | | yesterday_current_limit_up_records = kpl_data_manager.get_yesterday_current_limit_up_records() |
| | | CodePlateKeyBuyManager.update_can_buy_blocks(code, |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.latest_origin_datas, |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.total_datas, |
| | | yesterday_codes, |
| | | yesterday_current_limit_up_records, |
| | | block_info.get_before_blocks_dict(), |
| | | kpl_data_manager.KPLLimitUpDataRecordManager.get_current_reason_codes_dict()) |
| | | can_buy_result = CodePlateKeyBuyManager.can_buy(code) |
| | |
| | | can_buy_result = cls.__get_can_buy_block(code) |
| | | if can_buy_result is None: |
| | | return False, True, "尚未获取到板块信息" |
| | | if not can_buy_result[0] and can_buy_result[1]: |
| | | # 独苗 |
| | | return False, True, "独苗不下单" |
| | | |
| | | l2_log.debug(code, "获取到的板块信息:{}", can_buy_result) |
| | | |
| | | # -------量的约束-------- |
| | |
| | | # HighIncreaseCodeManager().add_code(code) |
| | | return False, True, f"近日出现最大量,当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | |
| | | if can_buy_result[1]: |
| | | # 独苗 |
| | | # ------自由流通市值约束------ |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | | if zyltgb: |
| | | if zyltgb < 10 * 100000000: |
| | | return False, True, f"独苗,自由流通小于10亿({zyltgb})" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"独苗:量比({cls.volume_rate_info[code][0]})未达到60%" |
| | | |
| | | # 判断是否近2天是否为10天内最大量 |
| | | if k_format and len(k_format) >= 10 and k_format[9]: |
| | | # 是独苗 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"近2天有10日内最高量,量比({cls.volume_rate_info[code][0]})未达到30%" |
| | | if now_timestamp < int("100000") or int("130000") <= now_timestamp < int("133000"): |
| | | # 独苗必须9:30-10:00和13:00-13:30时间段内买 |
| | | return True, False, f"独苗:{can_buy_result[2]}" |
| | | else: |
| | | return False, True, f"独苗:当前时间不能买" |
| | | else: |
| | | if can_buy_result[0]: |
| | | return True, False, can_buy_result[2] |
| | | # 独苗不再下单 |
| | | # if can_buy_result[1]: |
| | | # # 独苗 |
| | | # # ------自由流通市值约束------ |
| | | # zyltgb = global_util.zyltgb_map.get(code) |
| | | # if zyltgb: |
| | | # if zyltgb < 10 * 100000000: |
| | | # return False, True, f"独苗,自由流通小于10亿({zyltgb})" |
| | | # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | # return False, True, f"独苗:量比({cls.volume_rate_info[code][0]})未达到60%" |
| | | # |
| | | # # 判断是否近2天是否为10天内最大量 |
| | | # if k_format and len(k_format) >= 10 and k_format[9]: |
| | | # # 是独苗 |
| | | # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | # return False, True, f"近2天有10日内最高量,量比({cls.volume_rate_info[code][0]})未达到30%" |
| | | # if now_timestamp < int("100000") or int("130000") <= now_timestamp < int("133000"): |
| | | # # 独苗必须9:30-10:00和13:00-13:30时间段内买 |
| | | # return True, False, f"独苗:{can_buy_result[2]}" |
| | | # else: |
| | | # return False, True, f"独苗:当前时间不能买" |
| | | # else: |
| | | if can_buy_result[0]: |
| | | return True, False, can_buy_result[2] |
| | | return False, True, can_buy_result[2] |
| | | |
| | | @classmethod |