Administrator
2024-06-05 cd830d988be0dfacd4fd5fac30630ae509fdb71b
l2/cancel_buy_strategy.py
@@ -303,6 +303,8 @@
    def cancel_success(self, code):
        self.clear(code)
        # 撤单成功之后就清除当前的成交
        HuaXinSellOrderStatisticManager.clear_latest_deal_volume(code)
    def __get_fast_deal_threshold_value(self, code, place_order_time_str):
        """
@@ -350,11 +352,16 @@
        try:
            if code in self.__max_buy_order_num_cache:
                max_num = self.__max_buy_order_num_cache[code]
                total_num, details = HuaXinSellOrderStatisticManager.get_latest_2s_continue_deal_volume(code)
                if total_num // 100 > max_num * 0.6:
                    return True, f"连续两秒抛压过大:{total_num // 100}/{max_num}手"
                details = HuaXinSellOrderStatisticManager.get_latest_3s_continue_deal_volumes(code)
                threshold_num = int(max_num * 0.5 * 100)
                count = 0
                for d in details:
                    if d[1] > threshold_num:
                        count += 1
                if count >= 2:
                    return True, f"连续3秒有2s抛压过大:{details} 最大值:{max_num}"
        except Exception as e:
            l2_log.f_cancel_debug(code,f"大抛压撤单计算出错:{str(e)}")
            l2_log.f_cancel_debug(code, f"大抛压撤单计算出错:{str(e)}")
        # 查询最近2秒成交是否超过阈值
@@ -429,10 +436,10 @@
        # 是否是下单3分钟内
        sub_time = tool.trade_time_sub(total_datas[-1]['val']['time'], total_datas[real_order_index]['val']['time'])
        if sub_time > 180:
            return False, "下单超过180s"
        if sub_time > 30:
            return False, "下单超过30s"
        if sub_time < 2:
        if sub_time <= 2:
            return False, "下单在2s内"
        limit_up_price = gpcode_manager.get_limit_up_price(code)