From 936ac7f6a724cfd166f8fa6eee483a7e2a20d98f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 12 七月 2024 17:42:12 +0800
Subject: [PATCH] 解决炸板买的问题

---
 main.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/main.py b/main.py
index f41f23f..c1abcb1 100644
--- a/main.py
+++ b/main.py
@@ -10,6 +10,7 @@
 
 from code_attribute import target_codes_manager, gpcode_manager, code_market_manager, history_k_data_util
 from code_attribute.gpcode_manager import CodesNameManager
+from code_attribute.limit_up_time_manager import FirstLimitUpTimeManager
 from db.redis_manager_delegate import RedisUtils
 from huaxin_client import l2_client_for_cb
 from huaxin_client.client_network import SendResponseSkManager
@@ -217,7 +218,8 @@
                     for k in temp_dict:
                         volume = sum([x["volume"] for x in temp_dict[k]])
                         x = temp_dict[k][0]
-                        r["buy_list"].append({"price": str(x["price"]), "tradeTime": x["tradeTime"], "volume": volume, "type":StrategyBuyOrderRefManager().get_strategy_type(x["orderRef"])})
+                        r["buy_list"].append({"price": str(x["price"]), "tradeTime": x["tradeTime"], "volume": volume,
+                                              "type": StrategyBuyOrderRefManager().get_strategy_type(x["orderRef"])})
                     r["createTime"] = int(buys[0]["tradeTime"].replace(":", ""))
 
                 if "sell_list" not in r:
@@ -357,6 +359,12 @@
                             cb_code, strategy_type):
                             # 宸茬粡涔颁簡涓旀病鍦ㄦ兂涔板崟
                             continue
+                        # 濡傛灉涔嬪墠灏辨定鍋滀簡涓旀病鍦ㄦ兂涔板崟涓�
+                        underlying_code = target_codes_manager.get_underlying_code(cb_code)
+                        underlying_limit_up_time = FirstLimitUpTimeManager().get_first_limit_up_time(underlying_code)
+                        if not WantBuyCodesManager().is_in_cache(cb_code, strategy_type) and underlying_limit_up_time:
+                            continue
+
                         # 鑾峰彇鍙浆鍊虹殑娑ㄥ仠浠�
                         market_info = code_market_manager.get_market_info(cb_code)
                         limit_up_price = target_codes_manager.get_limit_up_price(cb_code)
@@ -396,6 +404,9 @@
             if result:
                 # (浠g爜, 鏈�杩戠殑浠锋牸, 娑ㄥ箙, 涔�1浠凤紝 涔�1閲�, 鎴愪氦鎬婚噺, 涔板叆閲�, 鍗栧嚭閲�, 鏄ㄦ棩鏀剁洏浠�, 鏃堕棿鎴�)
                 code_market_manager.set_market_info(result)
+                time_str = l2_huaxin_util.convert_time(result[9])
+                if int(time_str.split(":", "")) < int("092455"):
+                    continue
                 code = result[0]
                 # 姝h偂闇�瑕佸姞杞芥澘鍧�
                 if code.find("11") != 0 and code.find("12") != 0:
@@ -406,6 +417,7 @@
                         KPLCodeJXBlockManager().load_jx_blocks(result[0], result[3],
                                                                float(limit_up_price),
                                                                KPLLimitUpDataRecordManager.get_current_reasons())
+                    FirstLimitUpTimeManager().process(result)
                 else:
                     # 鍙浆鍊轰唬鐮�,澶勭悊
                     sell_strategy.process_market_info(result, __BuyStrategyDataManager)

--
Gitblit v1.8.0