Administrator
2024-04-19 25d100b3b1702c23b4e9cc04e7e83c2f05a6ddaf
l2/cancel_buy_strategy.py
@@ -305,7 +305,7 @@
                m = x[1] * x[2]
                if max_money < m:
                    max_money = m
                total_deal_money += x[1] * x[2]
                total_deal_money += m
        if max_money >= 4990000:
            return True, f"有大于499w大卖单({max_money})"
@@ -386,16 +386,16 @@
            if need_cancel:
                return need_cancel, cancel_msg
            # S后撤取消
            if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
                # 不处理重复的卖单
                # 获取最新的成交时间
                latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
                if tool.trade_time_sub(latest_trade_time,
                                       total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
                    self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
            # if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
            #     # 不处理重复的卖单
            #     # 获取最新的成交时间
            #     latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
            #     if tool.trade_time_sub(latest_trade_time,
            #                            total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
            #         self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
            return False, "不满足撤单条件"
        finally:
            self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
            # self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
            pass
    def need_cancel_for_down(self, code, start_index, end_index):
@@ -1311,7 +1311,7 @@
                changed = False
        # 保存数据
        if changed:
            l2_log.l_cancel_debug(code, f"设置成交位临近撤单监控范围:{watch_indexes} 计算范围:{start_index}-{end_index}")
            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)