Administrator
2024-04-15 b83950b1759c2dc48163e3b57266eed4d66014f7
log_module/log_export.py
@@ -528,6 +528,33 @@
    return fdatas
def load_huaxin_active_sell_map(date=tool.get_now_date_str()):
    path = f"{constant.get_path_prefix()}/logs/huaxin/trade/l2_active_sell.{date}.log"
    fdatas = {}
    if os.path.exists(path):
        with open(path, 'r', encoding="utf-8") as f:
            lines = f.readlines()
            for line in lines:
                if line:
                    try:
                        data = line.split(" - ")[1].strip()
                        if data.startswith("["):
                            time_str = data[data.find("[") + 1:data.find("]")].strip()
                            data = data[data.find("]") + 1:].strip()
                        data = data.split("code=")[1].strip()
                        code = data[:data.find(" ")].strip()
                        data = data[data.find(" "):].strip()
                        data = eval(data)
                        l2_data = eval(data.split("#")[1])
                        if code not in fdatas:
                            fdatas[code] = set()
                        fdatas[code].add(data[0])
                    except:
                        pass
    return fdatas
if __name__ == '__main__':
    fdatas = load_huaxin_transaction_sell_no("600990")
    print(len(fdatas))