| | |
| | | if round(t.time() * 1000) - __start_time > 10: |
| | | __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time, |
| | | "获取m值数据耗时") |
| | | if False: # end_index - start_index < 10: |
| | | if True: # end_index - start_index < 10: |
| | | cls.__start_compute_buy(code, start_index, end_index, threshold_money, capture_time, is_first_code) |
| | | else: |
| | | # pass |
| | |
| | | l2_log.debug(code, "有虚拟下单,无买撤信号,开始执行买入,执行位置:{},截图时间:{}", unreal_buy_info[0], capture_time) |
| | | # unreal_buy_info 的内容格式为:(触法买操作下标,截图时间) |
| | | # 真实下单 |
| | | # cls.__buy(code, unreal_buy_info[1], local_today_datas[code][unreal_buy_info[0]], |
| | | # unreal_buy_info[0], is_first_code) |
| | | lp = LineProfiler() |
| | | lp.enable() |
| | | lp_wrap = lp(cls.__buy) |
| | | lp_wrap(code, unreal_buy_info[1], local_today_datas[code][unreal_buy_info[0]], |
| | | unreal_buy_info[0], is_first_code) |
| | | output = io.StringIO() |
| | | lp.print_stats(stream=output) |
| | | lp.disable() |
| | | logger_profile.info(output.getvalue()) |
| | | cls.__buy(code, unreal_buy_info[1], local_today_datas[code][unreal_buy_info[0]], |
| | | unreal_buy_info[0], is_first_code) |
| | | # lp = LineProfiler() |
| | | # lp.enable() |
| | | # lp_wrap = lp(cls.__buy) |
| | | # lp_wrap(code, unreal_buy_info[1], local_today_datas[code][unreal_buy_info[0]], |
| | | # unreal_buy_info[0], is_first_code) |
| | | # output = io.StringIO() |
| | | # lp.print_stats(stream=output) |
| | | # lp.disable() |
| | | # logger_profile.info(output.getvalue()) |
| | | |
| | | _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, |
| | | "已虚拟下单-执行真实下单 外部耗时") |
| | |
| | | # 数据尚未处理完毕,进行下一步处理 |
| | | l2_log.debug(code, "数据尚未处理完毕,进行下一步处理,处理进度:{} end_index:{}", compute_index, compute_end_index) |
| | | # 处理撤单步骤 |
| | | # cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | lp = LineProfiler() |
| | | lp.enable() |
| | | lp_wrap = lp(cls.__process_order) |
| | | lp_wrap(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | output = io.StringIO() |
| | | lp.print_stats(stream=output) |
| | | lp.disable() |
| | | logger_profile.info(output.getvalue()) |
| | | cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | # lp = LineProfiler() |
| | | # lp.enable() |
| | | # lp_wrap = lp(cls.__process_order) |
| | | # lp_wrap(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | # output = io.StringIO() |
| | | # lp.print_stats(stream=output) |
| | | # lp.disable() |
| | | # logger_profile.info(output.getvalue()) |
| | | |
| | | _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, |
| | | f"处理撤单步骤耗时,范围:{compute_index + 1}-{compute_end_index}", force=True) |