From d6b6be5eb2ae00a8ccf46bd7d53cd7d0c1e59c72 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 24 十一月 2023 19:19:37 +0800
Subject: [PATCH] 初始化独立某些方法

---
 code_attribute/first_target_code_data_processor.py |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/code_attribute/first_target_code_data_processor.py b/code_attribute/first_target_code_data_processor.py
index 79b4ff8..fddeab8 100644
--- a/code_attribute/first_target_code_data_processor.py
+++ b/code_attribute/first_target_code_data_processor.py
@@ -5,7 +5,6 @@
 # 澶勭悊棣栨澘浠g爜淇℃伅
 
 import constant
-import inited_data
 from code_attribute import gpcode_manager, gpcode_first_screen_manager, code_nature_analyse, \
     code_volumn_manager
 from code_attribute.code_data_util import ZYLTGBUtil
@@ -15,7 +14,7 @@
 from third_data.history_k_data_util import HistoryKDatasUtils
 from ths import l2_code_operate
 from trade import trade_data_manager, l2_trade_util
-from utils import global_util, tool
+from utils import global_util, tool, init_data_util
 
 __CodesPlateKeysManager = CodesHisReasonAndBlocksManager()
 
@@ -44,7 +43,7 @@
                 # 鑾峰彇娑ㄥ仠浠�
                 _limit_up_price = gpcode_manager.get_limit_up_price(code)
                 if not _limit_up_price:
-                    inited_data.re_set_price_pres([code], True)
+                    init_data_util.re_set_price_pres([code], True)
                     # 鍐嶆鑾峰彇娑ㄥ仠浠�
                     _limit_up_price = gpcode_manager.get_limit_up_price(code)
                 if _limit_up_price:
@@ -81,7 +80,7 @@
     for code in codes:
         # 濡傛灉娑ㄥ仠浠锋槸绌哄�煎氨闇�瑕佽缃槰鏃ユ敹鐩樹环鏍�
         if gpcode_manager.get_limit_up_price(code) is None:
-            inited_data.re_set_price_pres([code], True)
+            init_data_util.re_set_price_pres([code], True)
 
     # 鏉垮潡鍏抽敭瀛楀噯澶�  鏆傛椂鍒犻櫎
     # for code in codes:
@@ -112,11 +111,11 @@
             if limit_up_price is None:
                 continue
             try:
-                volumes_data = inited_data.get_volumns_by_code(code, 150)
-                volumes = inited_data.parse_max_volume(volumes_data[:90],
-                                                       code_nature_analyse.is_new_top(
-                                                           limit_up_price,
-                                                           volumes_data[:90]))
+                volumes_data = init_data_util.get_volumns_by_code(code, 150)
+                volumes = init_data_util.parse_max_volume(volumes_data[:90],
+                                                          code_nature_analyse.is_new_top(
+                                                              limit_up_price,
+                                                              volumes_data[:90]))
                 logger_first_code_record.info("{} 鑾峰彇鍒伴鏉�60澶╂渶澶ч噺锛歿}", code, volumes)
                 code_volumn_manager.set_histry_volumn(code, volumes[0], volumes[1], volumes[2])
 
@@ -186,7 +185,7 @@
     # 鑾峰彇娑ㄥ仠浠�
     if temp_codes:
         # 鑾峰彇娑ㄥ仠浠�
-        inited_data.re_set_price_pres(temp_codes)
+        init_data_util.re_set_price_pres(temp_codes)
         # 閲嶆柊鑾峰彇娑ㄥ仠浠�
         for code in temp_codes:
             limit_up_price = gpcode_manager.get_limit_up_price(code)
@@ -212,7 +211,7 @@
             gpcode_manager.FirstCodeManager().add_limited_up_record([code])
         pricePre = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code)
         if pricePre is None:
-            inited_data.re_set_price_pres([code])
+            init_data_util.re_set_price_pres([code])
 
         rate = round((float(price) - pricePre) * 100 / pricePre, 1)
         prices.append(
@@ -223,11 +222,3 @@
     logger_l2_codes_subscript.info(f"({request_id})l2浠g爜鐩稿叧鏁版嵁鍔犺浇瀹屾垚")
     return tick_datas
 
-
-if __name__ == "__main__":
-    code = "002308"
-    limit_up_price = gpcode_manager.get_limit_up_price(code)
-    volumes_data = inited_data.get_volumns_by_code(code, 150)
-    # 淇濆瓨K绾垮舰鎬�
-    k_format = code_nature_analyse.get_k_format(limit_up_price, volumes_data)
-    code_nature_analyse.CodeNatureRecordManager().save_k_format(code, k_format)
\ No newline at end of file

--
Gitblit v1.8.0