| | |
| | | total_deal_money += info[0] |
| | | total_deal_money_info_list.append(info) |
| | | if limit_up_price_money_list: |
| | | # 计算大单的阈值 |
| | | average_money = sum(limit_up_price_money_list) // len(limit_up_price_money_list) |
| | | self.set_big_order_threshold(code, average_money) |
| | | max_money = max(limit_up_price_money_list) |
| | | # 取max((平均值+最大单一半)/2, 平均值) |
| | | threshold_money = max((max_money // 2 + average_money) // 2, average_money) |
| | | self.set_big_order_threshold(code, threshold_money) |
| | | self.__already_total_deal_big_order_money[code] = (total_deal_money, pre_limit_up_price_money_list) |
| | | async_log_util.info(logger_l2_radical_buy_data, f"之前的大单:{code}-{total_deal_money}-{total_deal_money_info_list}") |
| | | |
| | |
| | | if len(buy1_list) < 2: |
| | | return False |
| | | latest_buy1 = buy1_list[-1][1] |
| | | if latest_buy1[0]*latest_buy1[1] > 500e4: |
| | | if latest_buy1[0] * latest_buy1[1] > 500e4: |
| | | # 最近的买1要小于500万 |
| | | return False |
| | | latest_volume = latest_buy1[1] |
| | | max_volume = max([x[1][1] for x in buy1_list]) |
| | | if max_volume//10 > latest_volume: |
| | | if max_volume // 10 > latest_volume: |
| | | # 当前量小于最大量的1/10 |
| | | return True |
| | | return False |
| | |
| | | return fblocks, before_fblocks |
| | | |
| | | @classmethod |
| | | def is_block_can_buy_with_block_in(cls, code, block): |
| | | def is_block_can_buy_with_block_in(cls, code, block, yesterday_limit_up_codes): |
| | | """ |
| | | 根据板块流入判断板块是否可买 |
| | | @param code: |
| | | @param block: |
| | | @return: |
| | | @return:板块是否可买, 是否需要大单够 |
| | | """ |
| | | jx_in_blocks = RealTimeKplMarketData.get_top_market_jingxuan_blocks() |
| | | if jx_in_blocks and block in jx_in_blocks: |
| | | return True |
| | | return True, False |
| | | # 获取当前板块涨停数量 |
| | | codes = LimitUpDataConstant.get_current_limit_up_block_codes(block) |
| | | if codes and len(codes) >= 5: |
| | | return True |
| | | return False |
| | | return True, False |
| | | else: |
| | | if tool.get_now_time_as_int() < 100000: |
| | | # 10点以前 |
| | | # 当前板块净流入>=0且历史涨停数量>=2且是老大和老二 |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(code) |
| | | if codes and len(codes) >= 2: |
| | | # 判断板块净流入 |
| | | in_money = RealTimeKplMarketData.get_jx_block_in_money(block) |
| | | if in_money and in_money >= 0: |
| | | # 净流入不为负 |
| | | # 获取首板的身位 |
| | | info = RadicalBuyBlockManager().get_history_index(code, block, yesterday_limit_up_codes, |
| | | ignore_open_limit_up=False) |
| | | if info[0] < 2: |
| | | return True, True |
| | | return False, False |
| | | |
| | | @classmethod |
| | | def is_radical_buy(cls, code, yesterday_limit_up_codes): |
| | |
| | | return set(), "没获取到板块" |
| | | # 获取精选净流入 |
| | | keys_in_jx = set() |
| | | msgs = [] |
| | | for k in keys_: |
| | | if cls.is_block_can_buy_with_block_in(code, k): |
| | | keys_in_jx.add(k) |
| | | block_info = cls.is_block_can_buy_with_block_in(code, k, yesterday_limit_up_codes) |
| | | if block_info[0]: |
| | | if block_info[1]: |
| | | # 要求大单够了才买 |
| | | big_deal_info = get_total_deal_big_order_info(code, gpcode_manager.get_limit_up_price_as_num(code)) |
| | | if big_deal_info[0] <= 0: |
| | | keys_in_jx.add(k) |
| | | else: |
| | | msgs.append(f"【{k}】大单不够") |
| | | else: |
| | | keys_in_jx.add(k) |
| | | if not keys_in_jx: |
| | | msgs.append(f"【{keys_}】板块未在精选流入中:") |
| | | # 板块尚未精选流入,且板块涨停代码个数是否<5个 |
| | | return set(), f"【{keys_}】板块未在精选流入中" |
| | | return set(), ",".join(msgs) |
| | | # 加想的票也必须在板块净流入中 |
| | | if WantBuyCodesManager().is_in_cache(code): |
| | | return set(keys_), "已加想" |