Administrator
2024-08-15 0e921bc8d68e830f15bb049dfb84b22bc05db788
bug修复
2个文件已修改
12 ■■■■■ 已修改文件
l2/l2_data_manager_new.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/buy_strategy_util.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -951,14 +951,16 @@
                        if not can_place_order:
                            try:
                                # 不能下单,判断小群撤是否可以下
                                if buy_strategy_util.is_has_small_batch_cancel(code, trade_index, order_begin_pos.buy_single_index):
                                if buy_strategy_util.is_has_small_batch_cancel(code, trade_index,
                                                                               order_begin_pos.buy_single_index):
                                    # 判断撤单比例是否足够
                                    if not buy_strategy_util.is_cancel_rate_reieved(code, 0.69,trade_index, order_begin_pos.buy_single_index):
                                    if not buy_strategy_util.is_cancel_rate_reieved(code, 0.69, trade_index,
                                                                                    order_begin_pos.buy_single_index):
                                        return False, True, f"板上放量不足,有小群撤, 整体撤单比例不足({trade_index}-{order_begin_pos.buy_single_index})"
                                else:
                                    return False, True, f"板上放量不足,且没有小群撤({trade_index}-{order_begin_pos.buy_single_index})"
                            except Exception as e:
                                l2_log.info(code, logger_l2_error, "板上放量不足异常:{}",str(e))
                                l2_log.info(code, logger_l2_error, "板上放量不足异常:{}", str(e))
                                return False, True, f"板上放量不足"
            # 上证下单需要有成交大单(包含主动买与被动买)或者挂买的大单
            if tool.is_sh_code(code):
@@ -1026,7 +1028,7 @@
                        code) / 1000
                    # 如果是首次下单,增加一次下单次数
                    place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code)
                    if place_order_count ==0:
                    if place_order_count == 0:
                        trade_data_manager.PlaceOrderCountManager().place_order(code)
                    return False, True, f"执行位批次数据量({buy_count})大于{THRESHOLD_BUY_COUNT}  {range_indexes[0]}-{range_indexes[1]}"
            # 暂时注释想买单功能
utils/buy_strategy_util.py
@@ -73,7 +73,7 @@
        if val["num"] < min_num:
            continue
        buy_index = l2_data_source_util.L2DataSourceUtils.get_buy_index_with_cancel_data_v2(val, buyno_map)
        buy_index = l2_data_source_util.L2DataSourceUtils.get_buy_index_with_cancel_data_v2(data, buyno_map)
        if buy_index and start_index <= buy_index:
            cancel_count += 1
    if buy_count == 0: