From e70bdf6ab8e20c122cd5eb9e5fd6e384ab903b8d Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 11 七月 2024 13:24:40 +0800
Subject: [PATCH] 买点的策略类型区分

---
 log_module/log_export.py |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/log_module/log_export.py b/log_module/log_export.py
index 4fa2a47..4b46480 100644
--- a/log_module/log_export.py
+++ b/log_module/log_export.py
@@ -143,7 +143,7 @@
 
 def load_kpl_blocks(date=tool.get_now_date_str()):
     fdatas = {}
-    path = f"{constant.LOG_DIR}/gp/kpl/kpl_blocks.{date}.log"
+    path = f"{constant.get_path_prefix()}/{constant.LOG_DIR}/gp/kpl/kpl_blocks.{date}.log"
     with open(path, 'r', encoding='utf-8') as file:
         lines = file.readlines()
         for line in lines:
@@ -156,8 +156,26 @@
     return fdatas
 
 
+def load_order_ref_strategy(date=tool.get_now_date_str()):
+    """
+    鍔犺浇涓嬪崟鐨刼rder_ref瀵瑰簲鐨勭瓥鐣�
+    :param date:
+    :return:
+    """
+    fdatas = {}
+    path = f"{constant.get_path_prefix()}/{constant.LOG_DIR}/gp/trade/trade.{date}.log"
+    with open(path, 'r', encoding='utf-8') as file:
+        lines = file.readlines()
+        for line in lines:
+            if line.find("鍙浆杞界瓥鐣ヤ笅鍗曠粨鏋�") > -1:
+                line = line.split("鍙浆杞界瓥鐣ヤ笅鍗曠粨鏋滐細")[1]
+                data = eval(line)
+                fdatas[data[0]] = data[1]
+    return fdatas
+
+
 if __name__ == "__main__":
-    fdatas = load_big_buy_order()
+    fdatas = load_order_ref_strategy()
     print(fdatas)
 
     pass

--
Gitblit v1.8.0