| | |
| | | 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: |
| | |
| | | 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 |
| | | # 从中间向两头遍历 |