Administrator
2023-08-23 a587a61c11a43182a13f1c04e276839299629e4e
l2/cancel_buy_strategy.py
@@ -503,7 +503,6 @@
        processed_index, cancel_num = self.__get_compute_data_cache(code)
        # 获取下单次数
        cancel_rate_threshold = self.__hCancelParamsManager.get_cancel_rate(volume_index)
        process_index = start_index
@@ -964,13 +963,23 @@
            return
        watch_indexes = set()
        # 小金额
        watch_indexes_small_money = set()
        for i in range(index + 1, total_data[-1]["index"] + 1):
            data = total_data[i]
            val = data['val']
            if not L2DataUtil.is_limit_up_price_buy(val):
                continue
            if val["num"] * float(val["price"]) <= constant.L_CANCEL_MIN_MONEY * 100:
            money = val["num"] * float(val["price"])
            if money <= constant.L_CANCEL_MIN_MONEY * 100:
                continue
            is_small_money = money < constant.L_CANCEL_BIG_MONEY * 100
            if len(
                    watch_indexes_small_money) >= constant.L_CANCEL_MIN_MONEY_COUNT and is_small_money:
                # 小金额的个数已满
                continue
            cancel_datas = local_today_num_operate_map.get(
                "{}-{}-{}".format(val["num"], "1", val["price"]))
            canceled = False
@@ -983,6 +992,10 @@
                        break
            if not canceled:
                watch_indexes.add(i)
                if is_small_money:
                    # 添加小金额
                    watch_indexes_small_money.add(i)
                if len(watch_indexes) >= constant.L_CANCEL_MAX_WATCH_COUNT:
                    break
        logger_l2_l_cancel.info(f"{code}:设置监听范围,成交进度-{index} 监听范围-{watch_indexes}")