Administrator
2024-06-12 4a49d02e136249e2178e0d8372da2e6064ac6176
cancel_strategy/s_l_h_cancel_strategy.py
@@ -35,7 +35,7 @@
        half_must_buy = False
        if not must_buy:
            try:
                can_buy_result =code_plate_key_manager.CodePlateKeyBuyManager.can_buy(code)
                can_buy_result = code_plate_key_manager.CodePlateKeyBuyManager.can_buy(code)
                if can_buy_result and can_buy_result[0]:
                    if can_buy_result[0][1] <= 1 and can_buy_result[0][2] >= 3:
                        # 炸板率>60%以上就不加半红
@@ -1014,16 +1014,17 @@
                    break
        changed = True
        __last_l_up_compute_info = self.__last_l_up_compute_info.get(code)
        if __last_l_up_compute_info:
            if __last_l_up_compute_info == watch_indexes:
        l_up_compute_info = self.__last_l_up_compute_info.get(code)
        if l_up_compute_info:
            if l_up_compute_info[1] == watch_indexes:
                changed = False
        # 保存数据
        if changed:
            threshold_time = 1 if tool.is_sz_code(code) else 2
            if  time.time() - __last_l_up_compute_info[0] < threshold_time:
                l2_log.l_cancel_debug(code, f"L前监控更新太频繁:{threshold_time}")
                return
            if l_up_compute_info:
                if time.time() - l_up_compute_info[0] < threshold_time:
                    l2_log.l_cancel_debug(code, f"L前监控更新太频繁:{threshold_time}")
                    return
            l2_log.l_cancel_debug(code, f"L前监控范围:{watch_indexes} 计算范围:{start_index}-{end_index}")
            self.__set_near_by_trade_progress_indexes(code, buy_single_index, watch_indexes)
        self.__last_l_up_compute_info[code] = (time.time(), watch_indexes)
@@ -1227,7 +1228,7 @@
                    if str(wi) in after_place_order_index_dict:
                        # 真实下单位置之后的按照权重比例来计算
                        canceled_num += total_data[wi]["val"]["num"] * (
                                    10 - after_place_order_index_dict[str(wi)]) // 10
                                10 - after_place_order_index_dict[str(wi)]) // 10
                    else:
                        canceled_num += total_data[wi]["val"]["num"]