Administrator
8 天以前 e3d9dbe4d2fbb02f42d82f0b5ca60847c61a93c1
bug修复
1个文件已修改
22 ■■■■ 已修改文件
cancel_strategy/s_l_h_cancel_strategy.py 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cancel_strategy/s_l_h_cancel_strategy.py
@@ -717,6 +717,7 @@
    """
    L后统计信息管理
    """
    def __init__(self):
        self.watch_indexes_statistic_info_dict = {}
        self.__db = 0
@@ -737,7 +738,7 @@
                    self.watch_indexes_statistic_info_dict[code] = val
    def get_statistic_info(self, code):
        return  self.watch_indexes_statistic_info_dict.get(code)
        return self.watch_indexes_statistic_info_dict.get(code)
    def remove_statistic_info(self, code):
        if code not in self.watch_indexes_statistic_info_dict:
@@ -749,11 +750,6 @@
        self.watch_indexes_statistic_info_dict[code] = val
        RedisUtils.setex_async(self.__db, f"l_down_watch_indexes_statistic_info-{code}", tool.get_expire(),
                               json.dumps(val))
# 计算成交位置之后的大单(特定笔数)的撤单比例
@@ -1950,6 +1946,7 @@
        # 计算已经成交的比例
        total_datas = local_today_datas.get(code)
        total_deal_nums, total_nums, total_cancel_num, total_after_num = 0, 0, 0, 0
        total_deal_count, total_count, total_cancel_count, total_after_count = 0, 0, 0, 0
        for index in watch_indexes_info[2]:
            data = total_datas[index]
            val = data["val"]
@@ -1959,25 +1956,30 @@
                                                                                                     local_today_canceled_buyno_map.get(
                                                                                                         code))
            total_nums += val["num"]
            total_count += 1
            if index > real_place_order_index_info[0]:
                # L后后半段
                total_after_num += val["num"]
                total_after_count += 1
            if left_count <= 0:
                total_cancel_num += val["num"]
                total_cancel_count += 1
            else:
                if index < trade_index:
                    total_deal_nums += val["num"]
                    total_deal_count += 1
        # 总单
        # 已撤单
        # 成交单
        fresults = [(total_nums, int(total_nums * limit_up_price * 100)),
                    (total_cancel_num, int(total_cancel_num * limit_up_price * 100)),
                    (total_deal_nums, int(total_deal_nums * limit_up_price * 100))]
        fresults = [(total_count, int(total_nums * limit_up_price * 100)),
                    (total_cancel_count, int(total_cancel_num * limit_up_price * 100)),
                    (total_deal_count, int(total_deal_nums * limit_up_price * 100))]
        if total_nums - total_after_num <= 0:
            fresults.append(100.00)
        else:
            fresults.append(round(total_cancel_num * 100 / (total_nums - total_after_num), 2))
        fresults.append(LCancelRateManager.get_cancel_rate(code)[0])
        fresults.append(LCancelRateManager.get_cancel_rate(code)[0]*100)
        return fresults