Administrator
2023-11-27 279edda6cfa67d88eb22eb38fcf62caccc805461
查找真实下单位置bug修复
1个文件已修改
14 ■■■■■ 已修改文件
l2/huaxin/huaxin_delegate_postion_manager.py 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/huaxin/huaxin_delegate_postion_manager.py
@@ -44,11 +44,6 @@
    exec_data = order_info[2]
    order_ref = order_info[4]
    shadow_price = order_info[5]
    # 获取量
    is_sz = code.startswith("00")
    # 提交到交易所的时间预估
    min_space_time_ms = -1 if is_sz else 50
    shadow_place_order_index = None
    # 查找影子挂单
    for d in datas:
@@ -69,7 +64,14 @@
    if shadow_place_order_index is None:
        return None
    total_datas = l2_data_util.local_today_datas.get(code)
    start_index = max(min(datas[0]["index"], shadow_place_order_index - 10), 0)
    # 找到不是同一ms的结束
    temp_start_index = shadow_place_order_index
    for i in range(shadow_place_order_index - 1, -1, -1):
        val = total_datas[i]["val"]
        if val["tms"] != total_datas[shadow_place_order_index]["val"]["tms"]:
            break
        temp_start_index = i
    start_index = max(min(temp_start_index, min(datas[0]["index"], shadow_place_order_index - 15)), 0)
    end_index = min(shadow_place_order_index + 10, datas[-1]["index"])
    real_place_index = None
    # 从中间向两头遍历