From fa6a3ab958ce9493833eef68ac62bd155be5d53e Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 28 十月 2022 15:09:15 +0800 Subject: [PATCH] 驾驶舱监听,不再处理同花顺14:55以后的交易队列数据 --- trade_data_manager.py | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/trade_data_manager.py b/trade_data_manager.py index b150d7b..bc6c1f9 100644 --- a/trade_data_manager.py +++ b/trade_data_manager.py @@ -192,6 +192,15 @@ else: return int(val) + def __save_current_price_codes_count(self,count): + key = "current_price_codes_count" + self.__get_redis().setex(key,10,count) + + def __get_current_price_codes_count(self): + key = "current_price_codes_count" + count = self.__get_redis().get(key) + return 0 if count is None else count + def process_rate(self, code, rate, time_str): # 9鐐瑰崐涔嬪墠鐨勬暟鎹笉澶勭悊 if int(time_str.replace(":", "")) < int("093000"): @@ -217,6 +226,14 @@ global_util.cuurent_prices[code] = (price, is_limit_up, round(time.time())) pass + # 鐜颁环浠g爜鏁伴噺 + def save_current_price_codes_count(self, count): + self.__save_current_price_codes_count(count) + + def get_current_price_codes_count(self): + return self.__get_current_price_codes_count() + + # 鏄惁涓烘按涓嬫崬 def is_under_water(self, code): time_seconds = self.__get_down_price_time_as_seconds(code) -- Gitblit v1.8.0