| | |
| | | __L2LimitUpSellManager = L2LimitUpSellManager() |
| | | __PlaceOrderCountManager = PlaceOrderCountManager() |
| | | __CodeNatureRecordManager = code_nature_analyse.CodeNatureRecordManager() |
| | | __MarketSituationManager=MarketSituationManager() |
| | | __MarketSituationManager = MarketSituationManager() |
| | | |
| | | # 获取代码评分 |
| | | @classmethod |
| | |
| | | if can_buy_result is None: |
| | | return False, True, "尚未获取到板块信息" |
| | | # -------量的约束-------- |
| | | volume_rate_thresholds = buy_condition_util.get_volume_rate_by_level( |
| | | 1), buy_condition_util.get_volume_rate_by_level(2) |
| | | |
| | | k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | if k_format and (k_format[1][0] or k_format[3][0]) and len(k_format) >= 12 and k_format[11]: |
| | | # 破前高/接近前高且30天内有涨停 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"股价创新高或者逼近前高且30天内有涨停,当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"股价创新高或者逼近前高且30天内有涨停,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | |
| | | # 上5个交易日有炸板/跌停之后 |
| | | # 上5个交易日有炸板之后 |
| | | if k_format and len(k_format) >= 11 and k_format[10]: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"上5个交易日炸板/跌停,量未达到60%({cls.volume_rate_info[code][0]})" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"上5个交易日炸板,量未达到{volume_rate_thresholds[1]}({cls.volume_rate_info[code][0]})" |
| | | |
| | | # 上5个交易日有跌停 |
| | | if k_format and len(k_format) >= 13 and k_format[12]: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.29: |
| | | return False, True, f"上5个交易日跌停,量未达到{0.29}({cls.volume_rate_info[code][0]})" |
| | | |
| | | # 获取量的参考日期 |
| | | if code in global_util.max60_volumn: |
| | | day = global_util.max60_volumn[code][1] |
| | | if day in HistoryKDatasUtils.get_latest_trading_date_cache(5): |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"参考量在最近5天,量未达到60%({cls.volume_rate_info[code][0]})" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"参考量在最近5天,量未达到{volume_rate_thresholds[1]}({cls.volume_rate_info[code][0]})" |
| | | # 获取市场行情 |
| | | situation = cls.__MarketSituationManager.get_situation_cache() |
| | | zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation) |
| | |
| | | zyltgb = zylt_threshold[1] + 1 |
| | | |
| | | if zyltgb >= zylt_threshold[0]: |
| | | return False, True, f"{zylt_threshold[0]//100000000}亿以上的都不买({zyltgb})" |
| | | return False, True, f"{zylt_threshold[0] // 100000000}亿以上的都不买({zyltgb})" |
| | | |
| | | if HighIncreaseCodeManager().is_in(code): |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.8: |
| | |
| | | if not can_buy_result[0] and can_buy_result[1]: |
| | | msg_list.append("独苗") |
| | | if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]})不下单({can_buy_result[4]})自由流通市值({zyltgb})不满足条件" |
| | | # 如果没有辨识度才不买 |
| | | if k_format and k_format[8][0]: |
| | | # 有辨识度 |
| | | pass |
| | | else: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]})不下单({can_buy_result[4]})自由流通市值({zyltgb})不满足条件" |
| | | if k_format and (k_format[1][0] or k_format[3][0]): |
| | | msg_list.append("股价创新高或者逼近前高") |
| | | # 股价创新高或者逼近前高 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]}),股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]}),股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | else: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]}),当日量比({cls.volume_rate_info[code][0]})小于0.3" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0]: |
| | | return False, True, f"强势10分钟,独苗({can_buy_result[4]}),当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}" |
| | | else: |
| | | msg_list.append("非独苗") |
| | | if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]: |
| | | msg_list.append("不满足自由流通") |
| | | if k_format and (k_format[1][0] or k_format[3][0]): |
| | | # 股价创新高或者逼近前高 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"强势10分钟,后排,不满足自由市值,股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"强势10分钟,后排,不满足自由市值,股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | else: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"强势10分钟,后排,不满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于0.3" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0]: |
| | | return False, True, f"强势10分钟,后排,不满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}" |
| | | else: |
| | | msg_list.append("满足自由流通") |
| | | # 后排,满足自由流通市值需要下单 |
| | |
| | | if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]: |
| | | if k_format and (k_format[1][0] or k_format[3][0]): |
| | | # 股价创新高或者逼近前高 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"非强势10分钟,强势主线后排,不满足自由市值,股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"非强势10分钟,强势主线后排,不满足自由市值,股价创新高或者逼近前高,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | else: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"非强势10分钟,强势主线后排,不满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于0.3" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0]: |
| | | return False, True, f"非强势10分钟,强势主线后排,不满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}" |
| | | else: |
| | | if k_format and (k_format[1][0] or k_format[3][0]): |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"非强势10分钟,强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于0.3" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0]: |
| | | return False, True, f"非强势10分钟,强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}" |
| | | else: |
| | | # 非强势主线 |
| | | if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"非强势10分钟,非强势主线后排,不满足自由市值, 当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"非强势10分钟,非强势主线后排,不满足自由市值, 当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | else: |
| | | if k_format and (k_format[1][0] or k_format[3][0]): |
| | | # 股价创新高或者逼近前高 |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: |
| | | return False, True, f"非强势10分钟,非强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于0.6" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: |
| | | return False, True, f"非强势10分钟,非强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}" |
| | | else: |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.3: |
| | | return False, True, f"非强势10分钟,非强势主线后排, 满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于0.3" |
| | | if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[0]: |
| | | return False, True, f"非强势10分钟,非强势主线后排, 满足自由市值,当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}" |
| | | return True, False, can_buy_result[2] |
| | | |
| | | @classmethod |