Administrator
2024-06-13 ddd49deef7ac6daff95086f112a0061a641c4fe3
log_module/log_export.py
@@ -124,7 +124,7 @@
        date = datetime.datetime.now().strftime("%Y-%m-%d")
    pos_list = []
    path_ = "{}/logs/gp/l2/l2_process.{}.log".format(constant.get_path_prefix(), date)
    if os.path.exists(path_):
    try:
        with open(path_, mode='r',
                  encoding="utf-8") as f:
            while True:
@@ -141,6 +141,8 @@
                            pos_list.append((int(line.split("-")[0]), int(line.split("-")[1])))
                        except Exception as e:
                            logging.exception(e)
    except:
        pass
    return pos_list
@@ -626,6 +628,23 @@
    return fdatas
def load_huaxin_order_detail(date=tool.get_now_date_str()):
    """
    加载L2逐笔委托数据
    @param date:
    @return:
    """
    fdatas = []
    path = f"{constant.get_path_prefix()}/logs/huaxin/l2/orderdetail.{date}.log"
    lines = __load_file_content(path)
    for line in lines:
        if line:
            time = __get_async_log_time(line)
            line = line[line.rfind("#") + 1:]
            fdatas.append((time, eval(line)))
    return fdatas
def load_pre_close_price(date=tool.get_now_date_str()):
    """
    加载之前的收盘价