| | |
| | | # 只统计主动买 |
| | | if d[7] > d[6]: |
| | | continue |
| | | time_str = '' |
| | | if d[3] in time_dict: |
| | | time_str = time_dict[d[3]] |
| | | else: |
| | |
| | | deal_list = cls.__deal_active_buy_volume_list_dict.get(code) |
| | | if not deal_list: |
| | | return [] |
| | | fdatas = [deal_list[-1]] |
| | | latest_time = deal_list[-1][0] |
| | | fdatas = [] |
| | | # 从倒数第二个数据计算 |
| | | for i in range(len(deal_list) - 1, -1, -1): |
| | | if tool.trade_time_sub(fdatas[0][0], deal_list[i][0]) < 6: |
| | | if tool.trade_time_sub(latest_time, deal_list[i][0]) < 6: |
| | | fdatas.append(deal_list[i]) |
| | | return fdatas |
| | | |
| | |
| | | # 获取最近的主动买成交量 |
| | | deal_infos = HuaXinSellOrderStatisticManager.get_latest_6s_active_buy_deal_volumes(code) |
| | | async_log_util.info(logger_l2_radical_buy, f"最近主动买成交:{code}-{deal_infos}") |
| | | async_log_util.info(logger_l2_radical_buy) |
| | | if refer_sell_data and refer_sell_data[1] > 100 * 1e4: |
| | | if refer_sell_data: # and refer_sell_data[1] > 100 * 1e4: |
| | | # 总卖额要大于100w |
| | | deal_volume = 0 |
| | | for i in range(len(deal_infos) - 1, -1, -1): |
| | | for i in range(0, len(deal_infos)): |
| | | # >=统计到的总卖 |
| | | if int(refer_sell_time.replace(":", "")) > int(deal_infos[i][0].replace(":", "")): |
| | | break |
| | | deal_volume += deal_infos[i][1] |
| | | async_log_util.info(logger_l2_radical_buy, f"成交量:{deal_volume}/{refer_sell_data[2]}") |
| | | # 判断参考时间之后是否有大单成交 |
| | | big_deal_money_list = BigOrderDealManager().get_total_buy_money_list(code) |
| | | if len(big_deal_money_list)>0: |
| | | if len(big_deal_money_list) > 0 or True: |
| | | # 有大单成交 |
| | | yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes() |
| | | if yesterday_codes is None: |
| | | yesterday_codes = set() |
| | | result = RadicalBuyBlockManager.is_radical_buy(code, yesterday_codes) |
| | | async_log_util.info(logger_l2_radical_buy, f"计算板块结果:{code}-{result}") |
| | | else: |
| | | volume_rate = code_volumn_manager.get_volume_rate(code) |
| | | async_log_util.info(logger_l2_radical_buy, f"图形不符合要求:{code},量比:{volume_rate}") |
| | | except Exception as e: |
| | | async_log_util.info(logger_debug, f"激进买计算异常:{str(e)}") |
| | | |
| | |
| | | # 计算 |
| | | # 获取开1的板块 |
| | | open_limit_up_code_dict = kpl_data_constant.open_limit_up_code_dict_for_radical_buy |
| | | if not open_limit_up_code_dict: |
| | | return False, "没有首板开1的数据" |
| | | open_limit_up_blocks = set() |
| | | for c in open_limit_up_code_dict: |
| | | open_limit_up_blocks |= open_limit_up_code_dict[c][1] |
| | | if open_limit_up_code_dict: |
| | | for c in open_limit_up_code_dict: |
| | | open_limit_up_blocks |= open_limit_up_code_dict[c][1] |
| | | # 获取代码的板块 |
| | | keys_, k1_, k11_, k2_, k3_, k4_ = cls.__TargetCodePlateKeyManager.get_plate_keys(code, contains_today=False) |
| | | match_blocks = open_limit_up_blocks & keys_ |
| | | if not match_blocks: |
| | | return False, "没匹配到开1的板块" |
| | | can_buy_blocks = set() |
| | | msges = [] |
| | | for b in match_blocks: |