| | |
| | | @param day: |
| | | @return: |
| | | """ |
| | | print("开始处理成交大单数据", day, big_order_path, target_code) |
| | | print("*******开始处理成交大单数据", day, big_order_path, target_code) |
| | | l2_data_manager_dict = {} |
| | | # 解析数据 |
| | | __start_time = time.time() |
| | | transaction_data = parse_transaction(day) |
| | | print("Transaction 读取完毕", len(transaction_data), "耗时", int(time.time() - __start_time)) |
| | | print("*******Transaction 读取完毕", len(transaction_data), "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | ngtstick_data = parse_ngtstick(day) |
| | | print("NGTSTick 读取完毕", len(ngtstick_data), "耗时", int(time.time() - __start_time)) |
| | | print("*******NGTSTick 读取完毕", len(ngtstick_data), "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | big_order_list = [] |
| | | for index, row in enumerate(transaction_data): |
| | |
| | | while not l2_data_manager.big_accurate_sell_order_queue.empty(): |
| | | data = l2_data_manager.big_accurate_sell_order_queue.get() |
| | | big_order_list.append((code, 1, data)) |
| | | print("Transaction 处理完毕", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | print("********Transaction 处理完毕", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | |
| | | for index, row in enumerate(ngtstick_data): |
| | |
| | | while not l2_data_manager.big_accurate_sell_order_queue.empty(): |
| | | data = l2_data_manager.big_accurate_sell_order_queue.get() |
| | | big_order_list.append((code, 1, data)) |
| | | print("NGTSTick 处理完毕", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | print("********NGTSTick 处理完毕", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | # 读取剩余的未读数据的代码 |
| | | for code in l2_data_manager_dict: |
| | |
| | | while not l2_data_manager.big_accurate_sell_order_queue.empty(): |
| | | data = l2_data_manager.big_accurate_sell_order_queue.get() |
| | | big_order_list.append((code, 1, data)) |
| | | print("开始写入本地文件:", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | print("********开始写入本地文件:", len(big_order_list), "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | # 开始写入本地文件 |
| | | with open(big_order_path, mode='w', encoding='utf-8') as f: |
| | | for order in big_order_list: |
| | | f.write(f"{order}") |
| | | print("写入本地文件结束:", "耗时", int(time.time() - __start_time)) |
| | | f.write(f"{order}\n") |
| | | print("*******写入本地文件结束:", "耗时", int(time.time() - __start_time)) |
| | | __start_time = time.time() |
| | | |
| | | |