From 6f324f1471a5e28188e9f4206b46cbafdf09d04c Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 16 一月 2023 17:58:31 +0800
Subject: [PATCH] 增加图像识别接口,禁止下单策略优化

---
 trade_data_manager.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/trade_data_manager.py b/trade_data_manager.py
index 3707b57..9bf631e 100644
--- a/trade_data_manager.py
+++ b/trade_data_manager.py
@@ -229,7 +229,7 @@
         # 9鐐瑰崐涔嬪墠鐨勬暟鎹笉澶勭悊
         if int(time_str.replace(":", "")) < int("093000"):
             return
-        # now_str = datetime.datetime.now().strftime("%H:%M:%S")
+        # now_str = tool.get_now_time_str()
         if rate >= 0:
             down_start_time = self.__get_last_down_price_time(code)
             if down_start_time is None:
@@ -262,12 +262,18 @@
         return self.__get_current_price_codes_count()
 
     # 鏄惁涓烘按涓嬫崬
-    def is_under_water(self, code):
+    def is_under_water(self, code, now_time=None):
         time_seconds = self.__get_down_price_time_as_seconds(code)
         if time_seconds is None:
             return False
         else:
-            return time_seconds >= constant.UNDER_WATER_PRICE_TIME_AS_SECONDS
+            if time_seconds >= constant.UNDER_WATER_PRICE_TIME_AS_SECONDS:
+                if now_time is None:
+                    now_time = tool.get_now_time_str()
+                space = tool.trade_time_sub(now_time, "09:30:00")
+                if space > 0 and time_seconds / space >= 0.2:
+                    return True
+            return False
 
     # 褰撳墠浠g爜鏄惁娑ㄥ仠
     def current_is_limit_up(self, code):

--
Gitblit v1.8.0