From 954e42723fab626b33f6dbff9246bd235981fe7a Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 09 十二月 2022 19:22:38 +0800
Subject: [PATCH] 撤单策略初步修改

---
 juejin.py |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/juejin.py b/juejin.py
index 1269d8a..84b1900 100644
--- a/juejin.py
+++ b/juejin.py
@@ -58,6 +58,10 @@
 
 
 def init_data():
+    # 閲嶇疆鎵�鏈夌殑澶у崟鏁版嵁
+    big_money_num_manager.reset_all()
+    # 娓呴櫎姘翠笅鎹炴暟鎹�
+    __actualPriceProcessor.clear_under_water_data()
     # 杞藉叆琛屼笟鑲$エ浠g爜
     global_data_loader.load_industry()
     # 杞藉叆浠g爜鑷敱娴侀�氬競鍊�
@@ -68,6 +72,10 @@
 
 # 姣忔棩鍒濆鍖�
 def everyday_init():
+    # 浜ゆ槗鏅傞枔涓嶈兘鍋氬垵濮嬪寲
+    if not tool.is_init_time():
+        raise Exception("浜ゆ槗鏃堕棿涓嶈兘鍒濆鍖�")
+
     codes = gpcode_manager.get_gp_list()
     logger_system.info("姣忔棩鍒濆鍖�")
 
@@ -246,6 +254,9 @@
 def accpt_prices(prices):
     print("浠锋牸浠g爜鏁伴噺锛�", len(prices))
     __actualPriceProcessor.save_current_price_codes_count(len(prices))
+    # 閲囬泦鐨勪唬鐮佹暟閲忎笉瀵�
+    if len(gpcode_manager.get_gp_list()) - len(prices) > 2:
+        return
     now_str = datetime.datetime.now().strftime("%H:%M:%S")
     now_strs = now_str.split(":")
     now_second = int(now_strs[0]) * 60 * 60 + int(now_strs[1]) * 60 + int(now_strs[2])
@@ -276,7 +287,10 @@
                     logging.exception(e)
 
                 try:
-                    __actualPriceProcessor.save_current_price(code, price, gpcode_manager.get_limit_up_price_by_preprice(pricePre) == tool.to_price(decimal.Decimal(d["price"])))
+                    __actualPriceProcessor.save_current_price(code, price,
+                                                              gpcode_manager.get_limit_up_price_by_preprice(
+                                                                  pricePre) == tool.to_price(
+                                                                  decimal.Decimal(d["price"])))
                 except Exception as e:
                     logging.exception(e)
 

--
Gitblit v1.8.0