Administrator
2023-11-20 ab61b50ef2feede9f98ee10052ba19deb69287e6
l2/cancel_buy_strategy.py
@@ -712,10 +712,8 @@
    def get_watch_index_dict(self, code):
        return {}, set()
    def start_compute_watch_indexes(self,code,buy_single_index):
    def start_compute_watch_indexes(self, code, buy_single_index):
        self.__compute_watch_index(code, buy_single_index)
# ---------------------------------D撤-------------------------------
@@ -1427,7 +1425,7 @@
            return True
        # 计算已经成交的比例
        total_datas = local_today_datas.get(code)
        total_deal_nums=0
        total_deal_nums = 0
        total_nums = 1
        for index in watch_indexes:
            data = total_datas[index]
@@ -1437,11 +1435,11 @@
                                                                                                     total_datas,
                                                                                                     local_today_canceled_buyno_map.get(
                                                                                                         code))
            total_nums +=val["num"]
            if left_count >0 and index < trade_index:
                total_deal_nums+=val["num"]
            total_nums += val["num"]
            if left_count > 0 and index < trade_index:
                total_deal_nums += val["num"]
        thresh_hold_rate = LCancelRateManager.get_cancel_rate(code)
        if  total_deal_nums/total_nums > 1 - thresh_hold_rate-0.05:
        if total_deal_nums / total_nums > 1 - thresh_hold_rate - 0.05:
            return False
        return True
@@ -1473,9 +1471,6 @@
                logger_l2_l_cancel.exception(e)
                raise e
        return can_cancel, cancel_data, extra_msg
    def place_order_success(self, code):
        self.clear(code)