Administrator
2023-11-20 ab61b50ef2feede9f98ee10052ba19deb69287e6
Bug修复
3个文件已修改
26 ■■■■■ 已修改文件
l2/cancel_buy_strategy.py 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/huaxin/huaxin_delegate_postion_manager.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_util.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)
l2/huaxin/huaxin_delegate_postion_manager.py
@@ -62,6 +62,8 @@
            continue
        if L2DataUtil.time_sub_as_ms(val, exec_data['val']) >= 1000:
            continue
        if not L2DataUtil.is_buy(val):
            continue
        shadow_place_order_index = d["index"]
        break
    if shadow_place_order_index is None:
l2/l2_data_util.py
@@ -449,6 +449,13 @@
            return True
        return False
    # 是否为买
    @classmethod
    def is_buy(cls, val):
        if int(val["operateType"]) == 0:
            return True
        return False
    # l2时间差值
    @classmethod
    def time_sub_as_ms(cls, val1, val2):