Administrator
2025-06-27 9949e2de0c9f0624a0698a305b5d3ad52799e906
L撤bug修改/RD撤生效时间设置为60s
2个文件已修改
14 ■■■■■ 已修改文件
cancel_strategy/s_l_h_cancel_strategy.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cancel_strategy/s_l_h_cancel_strategy.py
@@ -1478,7 +1478,7 @@
            l2_log.l_cancel_debug(code, "将L2后后半段备用大单加入计算出错:{}", str(e))
        # 计算监听的总条数
        total_num = 0
        max_num = 0
        max_num, max_num_count = 0, 0
        thresh_hold_rate, must_buy = LCancelRateManager.get_cancel_rate(code)
        for wi in watch_indexes:
@@ -1497,6 +1497,9 @@
            total_num += total_data[wi]["val"]["num"] * total_data[wi]["re"]
            if total_data[wi]["val"]["num"] > max_num:
                max_num = total_data[wi]["val"]["num"]
                max_num_count = 1
            elif total_data[wi]["val"]["num"] == max_num:
                max_num_count += 1
        # 判断撤单中是否有监听中的索引
        need_compute = False
        for i in range(start_index, end_index + 1):
@@ -1548,13 +1551,13 @@
            # 除开最大单的影响权重
            if not must_buy:
                temp_thresh_hold_rate = round((total_num - max_num) * 0.9 / total_num, 2)
                temp_thresh_hold_rate = round((total_num - max_num * max_num_count) * 0.9 / total_num, 2)
                if thresh_hold_rate > temp_thresh_hold_rate:
                    # 目标撤单比例大于大单撤单比例就取比例均值
                    thresh_hold_rate = round((thresh_hold_rate + temp_thresh_hold_rate) / 2, 2)
            l2_log.l_cancel_debug(code,
                                  f"L后计算范围:{start_index}-{end_index},已撤单比例:{rate}/{thresh_hold_rate}, 下单位之后的索引:{after_place_order_index_dict}")
                                  f"L后计算范围:{start_index}-{end_index},已撤单比例:{rate}/{thresh_hold_rate}, 下单位之后的索引:{after_place_order_index_dict}, 最大单-({max_num},{max_num_count})")
            if rate >= thresh_hold_rate:
                canceled_indexes.sort()
                l2_log.l_cancel_debug(code, f"L后撤单,撤单位置:{canceled_indexes[-1]}")
l2/cancel_buy_strategy.py
@@ -319,7 +319,8 @@
        if not watch_indexes:
            return False, None, "无大单监听"
        total_datas = local_today_datas.get(code)
        if tool.trade_time_sub(total_datas[start_index]["val"]["time"] ,total_datas[list(watch_indexes)[0]]["val"]["time"]) > 60:
        if tool.trade_time_sub(total_datas[start_index]["val"]["time"],
                               total_datas[list(watch_indexes)[0]]["val"]["time"]) > 60:
            return False, None, "只有前60s生效"
        cancel_indexes = set()
@@ -545,7 +546,7 @@
        if total_left_money < 1e8:
            if total_left_count <= 1 or (
                    total_left_count <= THRESHOLD_COUNT and limit_up_price and total_left_num * float(
                    limit_up_price) < THRESHOLD_MONEY_W * 100):
                limit_up_price) < THRESHOLD_MONEY_W * 100):
                return True, f"剩余笔数({total_left_count})/金额({round(total_left_num * float(limit_up_price) * 100)})不足,成交进度:{trade_index},真实下单位置:{real_order_index} 阈值:({THRESHOLD_MONEY_W},{THRESHOLD_COUNT}) "
        return False, f"不满足撤单条件: 成交进度-{trade_index} 真实下单位置-{real_order_index} total_left_count-{total_left_count} total_left_num-{total_left_num}"