From 178d119f552136d7e119ddab50a01e7f5d642186 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 22 八月 2024 23:38:40 +0800
Subject: [PATCH] 绿名单 /股票板块修改
---
code_attribute/first_target_code_data_processor.py | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/code_attribute/first_target_code_data_processor.py b/code_attribute/first_target_code_data_processor.py
index eaff5e7..33a1fde 100644
--- a/code_attribute/first_target_code_data_processor.py
+++ b/code_attribute/first_target_code_data_processor.py
@@ -10,7 +10,9 @@
from code_attribute.code_data_util import ZYLTGBUtil
from code_attribute.code_nature_analyse import HighIncreaseCodeManager
from code_attribute.gpcode_manager import WantBuyCodesManager
+from log_module import async_log_util
from log_module.log import logger_first_code_record, logger_l2_codes_subscript
+from third_data import history_k_data_manager
from third_data.code_plate_key_manager import CodesHisReasonAndBlocksManager
from third_data.history_k_data_manager import HistoryKDataManager
from third_data.history_k_data_util import HistoryKDatasUtils, JueJinApi
@@ -68,7 +70,7 @@
# 鑾峰彇娑ㄥ仠浠�
_limit_up_price = gpcode_manager.get_limit_up_price(code)
if not _limit_up_price:
- init_data_util.re_set_price_pres([code], True)
+ history_k_data_manager.re_set_price_pres([code], True)
# 鍐嶆鑾峰彇娑ㄥ仠浠�
_limit_up_price = gpcode_manager.get_limit_up_price(code)
if _limit_up_price:
@@ -84,7 +86,7 @@
if gpcode_manager.get_limit_up_price(code) is None:
need_get_limit_up_codes.add(code)
if need_get_limit_up_codes:
- init_data_util.re_set_price_pres(list(need_get_limit_up_codes), True)
+ history_k_data_manager.re_set_price_pres(list(need_get_limit_up_codes), True)
logger_l2_codes_subscript.info(f"{request_id}鍔犺浇l2浠g爜娑ㄥ仠浠风粨鏉�")
# 鑾峰彇60澶╂渶澶ц褰�
for code in codes:
@@ -106,6 +108,9 @@
volumes_data = HistoryKDataManager().get_history_bars(code, latest_trading_date)
if not volumes_data:
volumes_data = init_data_util.get_volumns_by_code(code, 150)
+ async_log_util.info(logger_l2_codes_subscript, f"{request_id}浠庣綉缁滃姞杞終绾挎暟鎹細{code}")
+ if not volumes_data:
+ continue
volumes = init_data_util.parse_max_volume(code, volumes_data[:90],
code_nature_analyse.is_new_top(code,
limit_up_price,
@@ -114,7 +119,7 @@
code,
limit_up_price,
volumes_data[:90]))
- logger_first_code_record.info("{} 鑾峰彇鍒伴鏉�60澶╂渶澶ч噺锛歿}", code, volumes)
+ async_log_util.info(logger_first_code_record, f"{code} 鑾峰彇鍒伴鏉�60澶╂渶澶ч噺锛歿volumes}")
code_volumn_manager.set_histry_volumn(code, volumes[0], volumes[1], volumes[2], volumes[3])
# 淇濆瓨K绾垮舰鎬�
@@ -183,7 +188,7 @@
logger_first_code_record.error(f"{request_id}-{code}:{str(e)}")
logger_first_code_record.exception(e)
- logger_l2_codes_subscript.info(f"{request_id}鍔犺浇l2浠g爜K绾跨粨鏉�")
+ async_log_util.info(logger_l2_codes_subscript, f"{request_id}鍔犺浇l2浠g爜K绾跨粨鏉�")
gpcode_manager.FirstCodeManager().add_record(codes)
# 鍒濆鍖栨澘鍧椾俊鎭紝鏆傛椂鍒犻櫎
@@ -225,7 +230,7 @@
# 鑾峰彇娑ㄥ仠浠�
if temp_codes:
# 鑾峰彇娑ㄥ仠浠�
- init_data_util.re_set_price_pres(temp_codes)
+ history_k_data_manager.re_set_price_pres(temp_codes)
# 閲嶆柊鑾峰彇娑ㄥ仠浠�
for code in temp_codes:
limit_up_price = gpcode_manager.get_limit_up_price(code)
@@ -251,7 +256,7 @@
gpcode_manager.FirstCodeManager().add_limited_up_record([code])
pricePre = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code)
if pricePre is None:
- init_data_util.re_set_price_pres([code])
+ history_k_data_manager.re_set_price_pres([code])
rate = round((float(price) - pricePre) * 100 / pricePre, 1)
prices.append(
@@ -259,5 +264,5 @@
"limit_up": is_limit_up})
gpcode_first_screen_manager.process_ticks(prices)
- logger_l2_codes_subscript.info(f"({request_id})l2浠g爜鐩稿叧鏁版嵁鍔犺浇瀹屾垚")
+ async_log_util.info(logger_l2_codes_subscript, f"({request_id})l2浠g爜鐩稿叧鏁版嵁鍔犺浇瀹屾垚")
return tick_datas
--
Gitblit v1.8.0