Administrator
2024-05-13 9cf6084a0b7a61a1ede7e739869f659a8ea5d253
l2/cancel_buy_strategy.py
@@ -1211,6 +1211,8 @@
                    if val["num"] < min_num:
                        continue
                    cancel_data = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code,
                                                                                                          j,
                                                                                                          total_datas,
@@ -1308,7 +1310,37 @@
                                                                                           cancel_data['val'])) <= 0:
                                watch_indexes.add(i)
                                break
                    # 获取真实下单位后面10笔大单
                    try:
                        # 真实下单位置后面的数据就只看大单
                        big_min_num = int(29900 / (float(gpcode_manager.get_limit_up_price(code))))
                        MIN_NUM = int(5000 / (float(gpcode_manager.get_limit_up_price(code))))
                        real_place_order_info = self.__real_place_order_index_dict.get(code)
                        if real_place_order_info and not real_place_order_info[1]:
                            # 从真实下单位往后找
                            after_count = 0
                            for i in range(real_place_order_info[0] + 1, total_datas[-1]['index']+1):
                                if after_count > 10:
                                    break
                                data = total_datas[i]
                                val = data['val']
                                # 涨停买,且未撤单
                                if not L2DataUtil.is_limit_up_price_buy(val):
                                    continue
                                # 小金额过滤
                                if val['num'] < MIN_NUM:
                                    continue
                                left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(
                                    code, i,
                                    total_datas,
                                    local_today_canceled_buyno_map.get(
                                        code))
                                if left_count > 0:
                                    after_count+=1
                                    if val['num']>=big_min_num:
                                        watch_indexes.add(i)
                    except Exception as e:
                        pass
                    self.__set_watch_indexes(code, buy_single_index, re_compute, watch_indexes)
                    l2_log.l_cancel_debug(code,
                                          f"设置监听范围({msg}){'(重新计算)' if re_compute else ''}, 数据范围:{re_start_index}-{end_index} 监听范围-{watch_indexes}")