| | |
| | | return False, None |
| | | watch_indexes = set([int(i) for i in watch_indexes]) |
| | | # 计算监听的总条数 |
| | | total_count = 0 |
| | | total_num = 0 |
| | | for wi in watch_indexes: |
| | | total_count += total_data[wi]["re"] |
| | | total_num += total_data[wi]["re"]*int(total_data[wi]["val"]["num"]) |
| | | # 判断撤单中是否有监听中的索引 |
| | | need_compute = False |
| | | for i in range(start_index, end_index + 1): |
| | |
| | | break |
| | | if need_compute: |
| | | # 计算撤单比例 |
| | | canceled_count = 0 |
| | | canceled_num = 0 |
| | | for wi in watch_indexes: |
| | | left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count(code, |
| | | wi, |
| | | total_data, |
| | | local_today_num_operate_map) |
| | | canceled_count += (total_data[wi]["re"] - left_count) |
| | | rate = round(canceled_count / total_count, 3) |
| | | logger_l2_l_cancel.info(f"计算范围:{start_index}-{end_index},已撤单比例:{rate}") |
| | | canceled_num += (total_data[wi]["re"] - left_count) * int(total_data[wi]["val"]["num"]) |
| | | rate = round(canceled_num / total_num, 3) |
| | | logger_l2_l_cancel.info(f"{code}:计算范围:{start_index}-{end_index},已撤单比例:{rate}") |
| | | if rate >= constant.L_CANCEL_RATE: |
| | | return True, total_data[-1] |
| | | |