| | |
| | | self.l_down = {} |
| | | |
| | | def set_l_down(self, code, rate): |
| | | async_log_util.info(logger_l2_l_cancel, f"人为修改L后撤单比例:{code}-{rate}") |
| | | self.l_down[code] = rate |
| | | |
| | | def get_l_down(self, code): |
| | |
| | | l2_log.l_cancel_debug(code, "将L2后后半段备用大单加入计算出错:{}", str(e)) |
| | | # 计算监听的总条数 |
| | | total_num = 0 |
| | | # 超大单的手数 |
| | | super_big_num_thresold = int(2e7/gpcode_manager.get_limit_up_price_as_num(code)/100) |
| | | max_num, max_num_count = 0, 0 |
| | | |
| | | |
| | | thresh_hold_rate, must_buy, cancel_rate_info = LCancelRateManager.get_cancel_rate(code) |
| | | for wi in watch_indexes: |
| | | if str(wi) in after_place_order_index_dict: |
| | |
| | | total_num += total_data[wi]["val"]["num"] * ( |
| | | 10 - after_place_order_index_by_dict[str(wi)]) // 10 |
| | | continue |
| | | |
| | | total_num += total_data[wi]["val"]["num"] * total_data[wi]["re"] |
| | | # 超过超大单就算超大单 |
| | | if total_data[wi]["val"]["num"] < super_big_num_thresold: |
| | | total_num += total_data[wi]["val"]["num"] |
| | | else: |
| | | total_num += super_big_num_thresold |
| | | if total_data[wi]["val"]["num"] > max_num: |
| | | max_num = total_data[wi]["val"]["num"] |
| | | max_num_count = 1 |
| | |
| | | total_num = 0 |
| | | max_num, max_num_count = 0, 0 |
| | | thresh_hold_rate, must_buy, cancel_rate_info = LCancelRateManager.get_cancel_rate(code) |
| | | |
| | | super_big_num_thresold = int(2e7 / gpcode_manager.get_limit_up_price_as_num(code) / 100) |
| | | for wi in watch_indexes: |
| | | if str(wi) in after_place_order_index_dict: |
| | | # 如果加红就需要计算分母 |
| | |
| | | total_num += total_data[wi]["val"]["num"] * ( |
| | | 10 - after_place_order_index_by_dict[str(wi)]) // 10 |
| | | continue |
| | | |
| | | total_num += total_data[wi]["val"]["num"] * total_data[wi]["re"] |
| | | if total_data[wi]["val"]["num"] < super_big_num_thresold: |
| | | total_num += total_data[wi]["val"]["num"] |
| | | else: |
| | | total_num += super_big_num_thresold |
| | | if total_data[wi]["val"]["num"] > max_num: |
| | | max_num = total_data[wi]["val"]["num"] |
| | | max_num_count = 1 |