Administrator
2024-04-24 d0f33825a0a6c6fb243bb4a1b4d30660bf821366
日志调整
3个文件已修改
45 ■■■■ 已修改文件
l2/cancel_buy_strategy.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/log_export.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -1520,7 +1520,7 @@
                                                                                                            code))
                if canceled_data:
                    canceled_indexes.append(canceled_data["index"])
                    canceled_count_weight += total_data[wi]["re"]
                    # 获取索引权重
                    pos_index = watch_indexes_list.index(wi)
                    if pos_index < len(WATCH_INDEX_WEIGHTS):
                        canceled_count_weight += WATCH_INDEX_WEIGHTS[pos_index]
l2/l2_data_manager_new.py
@@ -1356,46 +1356,14 @@
            if has_single:
                # 判断是否是板上买
                order_begin_pos.at_limit_up = cls.__is_at_limit_up_buy(code)
                # -------------计算信号位到成交位的纯买额(过远则为无效位置)-------------------
                if order_begin_pos.at_limit_up:
                    # 信号位是否有效
                    pass
                    # 获取成交进度位置
                    # trade_index, is_default = TradeBuyQueue().get_traded_index(code)
                    # if trade_index and not is_default:
                    #     m_base_val = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code)
                    #     thresh_hold_num = m_base_val * 4 // (float(gpcode_manager.get_limit_up_price(code)) * 100)
                    #     # 真实下单位到成交位置的纯买额 * 3
                    #     total_num = 0
                    #     for i in range(trade_index + 1, buy_single_index):
                    #         data = total_datas[i]
                    #         val = data["val"]
                    #         if not L2DataUtil.is_limit_up_price_buy(val):
                    #             continue
                    #         left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(
                    #             code,
                    #             data["index"],
                    #             total_datas,
                    #             local_today_canceled_buyno_map.get(
                    #                 code))
                    #         total_num += left_count * val["num"]
                    #         if total_num > thresh_hold_num:
                    #             break
                    #     if total_num > thresh_hold_num:
                    #         # 距离成交进度位置过远
                    #         l2_log.debug(code,
                    #                      f"获取的信号位无效(板上买,范围:{trade_index + 1}-{order_begin_pos.buy_single_index} 未成交总手{total_num}/阈值{thresh_hold_num})")
                    #         return None
                # -----------------------------买入计算初始化,计算纯买额阈值-----------------------
                cls.__last_buy_single_dict[code] = buy_single_index
                new_get_single = True
                order_begin_pos.num = 0
                order_begin_pos.count = 0
                order_begin_pos.buy_single_index = buy_single_index
                # 调整闪电下单的买入阈值
                # 总卖额的1倍
                order_begin_pos.threshold_money = int(sell_info[1] * 1.0)
                order_begin_pos.max_num_set = set()
                l2_log.debug(code, "获取到买入信号起始点:{} ,计算范围:{}-{} ,量比:{},是否板上买:{},数据:{} 模式:{}({}) 信号类型:{}",
                             buy_single_index,
@@ -1417,12 +1385,9 @@
        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "计算m值大单")
        threshold_money, msg = cls.__get_threshmoney(code)
        # threshold_money, msg = cls.__get_threshmoney(code)
        # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m值阈值计算")
        # 买入纯买额统计
        new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new, not_buy_msg = None, None, None, None, [], ""
        # 设置为总卖额
        new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, threshold_money_new, max_num_set_new, not_buy_msg = cls.__sum_buy_num_for_order_active(
log_module/log_export.py
@@ -149,7 +149,7 @@
    pos_list = []
    with open("{}/logs/gp/l2/l2_trade.{}.log".format(constant.get_path_prefix(), date), mode='r',
              encoding="utf-8") as f:
        latest_single=[None, None]
        latest_single = [None, None]
        while True:
            line = f.readline()
            if not line:
@@ -178,7 +178,7 @@
                for p in latest_single:
                    if p:
                        pos_list.append(p)
                latest_single = [None,None]
                latest_single = [None, None]
            elif line.find("触发撤单,撤单位置:") > 0:
                str_ = line.split("触发撤单,撤单位置:")[1].strip()
                index = str_[0:str_.find(" ")].strip()