Administrator
12 小时以前 6503f578ea263b18ac01810e07b7acbc82f63a8f
cancel_strategy/s_l_h_cancel_strategy.py
@@ -1181,6 +1181,14 @@
    # 设置真实下单位置
    def set_real_place_order_index(self, code, index, buy_single_index=None, is_default=False):
        """
        设置真实下单位置
        @param code:
        @param index:
        @param buy_single_index:
        @param is_default:
        @return: 是否需要撤单, 撤单原因
        """
        l2_log.l_cancel_debug(code, f"设置真实下单位-{index},buy_single_index-{buy_single_index}")
        self.__real_place_order_index_dict[code] = (index, is_default)
        RedisUtils.setex_async(self.__db, f"l_cancel_real_place_order_index-{code}", tool.get_expire(),
@@ -1193,7 +1201,15 @@
        if buy_single_index is not None:
            # L后撤从成交进度位开始计算
            self.compute_watch_index(code, buy_single_index, trade_index, index)
        self.__compute_trade_progress_near_by_indexes(code, buy_single_index, trade_index, index)
            # 设置非默认的真实下单位时,下单1分钟内,L后不足5笔就撤单
            if not is_default:
                total_datas = local_today_datas.get(code)
                if tool.trade_time_sub(total_datas[-1]['val']['time'], total_datas[index]['val']['time']) < 60:
                    watch_index_info = self.__cancel_watch_index_info_cache.get(code)
                    if watch_index_info and len(watch_index_info) >= 3 and len(watch_index_info[2]) < 5:
                        # 撤单
                        return True, "L后囊括不足5笔"
        return False, ""
    # 重新计算L前
    def re_compute_l_up_watch_indexes(self, code, buy_single_index):