Administrator
2023-08-17 9aff5f8831d836e8b531efbcc9375328e7ecd7ab
删除redis日志与时间日志
2个文件已修改
16 ■■■■■ 已修改文件
l2/l2_data_manager_new.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/log.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -226,6 +226,7 @@
    __Buy1PriceManager = code_price_manager.Buy1PriceManager()
    __AccountAvailableMoneyManager = AccountAvailableMoneyManager()
    __TradeBuyDataManager = trade_data_manager.TradeBuyDataManager()
    __LimitUpTimeManager =  limit_up_time_manager.LimitUpTimeManager()
    # 获取代码评分
    @classmethod
@@ -349,7 +350,7 @@
                        # 当前涨停价,设置涨停时间
                        logger_l2_process.info("开盘涨停:{}", code)
                        # 保存涨停时间
                        limit_up_time_manager.LimitUpTimeManager().save_limit_up_time(code, "09:30:00")
                        cls.__LimitUpTimeManager.save_limit_up_time(code, "09:30:00")
        total_datas = local_today_datas[code]
        # __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time,
@@ -362,7 +363,7 @@
            volume_rate = code_volumn_manager.get_volume_rate(code)
            volume_rate_index = code_volumn_manager.get_volume_rate_index(volume_rate)
            # 计算分值
            limit_up_time = limit_up_time_manager.LimitUpTimeManager().get_limit_up_time_cache(code)
            limit_up_time = cls.__LimitUpTimeManager.get_limit_up_time_cache(code)
            if limit_up_time is None:
                limit_up_time = tool.get_now_time_str()
            # score = first_code_score_manager.get_score(code, volume_rate, limit_up_time, True)
@@ -801,7 +802,7 @@
            if volumn_rate >= 1.3:
                return False, False, "最大量比超过1.3不能买"
            limit_up_time = limit_up_time_manager.LimitUpTimeManager().get_limit_up_time_cache(code)
            limit_up_time =cls.__LimitUpTimeManager.get_limit_up_time_cache(code)
            if limit_up_time is not None:
                limit_up_time_seconds = l2.l2_data_util.L2DataUtil.get_time_as_second(
                    limit_up_time)
@@ -950,7 +951,7 @@
                                                                                 0, min_money_w)
            if left_big_num > 0:
                # 重新获取分数与分数索引
                limit_up_time = limit_up_time_manager.LimitUpTimeManager().get_limit_up_time_cache(code)
                limit_up_time = cls.__LimitUpTimeManager.get_limit_up_time_cache(code)
                if limit_up_time is None:
                    limit_up_time = tool.get_now_time_str()
                score = first_code_score_manager.get_score(code, cls.volume_rate_info[code][0], limit_up_time, True,
@@ -1168,9 +1169,7 @@
                                        buy_nums, buy_count, max_num_set_new,
                                        cls.volume_rate_info[code][0])
            l2_log.debug(code, "__save_order_begin_data")
            limit_up_time_manager.LimitUpTimeManager().save_limit_up_time(code,
                                                                          total_datas[compute_index][
                                                                              "val"]["time"])
            cls.__LimitUpTimeManager.save_limit_up_time(code,total_datas[compute_index]["val"]["time"])
            l2_log.debug(code, "save_limit_up_time")
            cls.__virtual_buy(code, buy_single_index, compute_index, capture_time)
            l2_log.debug(code, "__virtual_buy")
log_module/log.py
@@ -225,6 +225,9 @@
                   rotation="00:00", compression="zip", enqueue=True)
        logger.add(sys.stdout,
                   filter=lambda record: record["extra"].get("name") == "local_huaxin_l1_show_info")
        logger.add(self.get_local_huaxin_path("l1", "show_info"),
                   filter=lambda record: record["extra"].get("name") == "local_huaxin_l1_show_info",
                   rotation="00:00", compression="zip", enqueue=True)
    def get_path(self, dir_name, log_name):
        path_str = "{}/logs/gp/{}/{}".format(constant.get_path_prefix(), dir_name, log_name) + ".{time:YYYY-MM-DD}.log"