| | |
| | | # 实时L2买1成交量 |
| | | def OnRealTimeBuy1Info(self, code, buy1_info): |
| | | # buy1_info: [买1时间,买1价格, 原始买1量, 实时买1量] |
| | | # 最终的买1为: 原始买1量+实时买1量 |
| | | async_log_util.info(logger_debug, f"OnRealTimeBuy1Info:{code}-{buy1_info}") |
| | | # L1DataProcessor.excute_sell_rule(code, buy1_info[3], buy1_info[1], "l2-real") |
| | | |
| | |
| | | logger_debug.exception(error) |
| | | logger_debug.error(f"L1处理出错:{current_info}") |
| | | use_time = time.time() - __start_time |
| | | if use_time > 1: |
| | | if use_time > 0.5: |
| | | # 记录超过1s的数据 |
| | | async_log_util.info("L1数据处理时间统计:thread-{} 总计用时-{} 平均耗时-{} 最大耗时-{}", |
| | | async_log_util.info(logger_debug, "L1数据处理时间统计:thread-{} 总计用时-{} 平均耗时-{} 最大耗时-{}", |
| | | tool.get_thread_id(), use_time, sum(use_time_list) / len(use_time_list), |
| | | max(use_time_list)) |
| | | |
| | |
| | | # 分批处理数据 |
| | | ds = [] |
| | | total_count = len(current_infos) |
| | | page = 20 |
| | | page = 10 |
| | | page_size = total_count // page + 1 |
| | | for p in range(page): |
| | | temp_list = current_infos[p * page_size:(p + 1) * page_size] |