From 6e71fbcb119e7068ba35380edaa5cc66e7c71f1b Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 27 十月 2022 16:21:05 +0800
Subject: [PATCH] 交易体系完善

---
 trade_queue_manager.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/trade_queue_manager.py b/trade_queue_manager.py
index adc48df..37dec69 100644
--- a/trade_queue_manager.py
+++ b/trade_queue_manager.py
@@ -47,9 +47,16 @@
         return val[0], val[1]
 
     # 杩斿洖鏄惁闇�瑕佹洿鏂版暟鎹�
-    def save(self, code, time_str, volumn):
+    def save(self, code, time_str, volumn,price):
+        # 瀹㈡埛绔暟鎹湭鍔犺浇鍑烘潵杩囨护
         if volumn < 1:
             return False
+        # 鍒ゆ柇鏄惁涓烘定鍋滀环
+        limit_up_price = gpcode_manager.get_limit_up_price(code)
+        if limit_up_price != tool.to_price(decimal.Decimal(price)):
+            # 闈炴定鍋滀环
+            volumn = 0
+
         # 涓嶄繚瀛樺拰涓婁竴娆$浉鍚岀殑鏁版嵁
         if code in self.__last_data and self.__last_data[code] == volumn:
             return False
@@ -112,10 +119,7 @@
         limit_up_price = gpcode_manager.get_limit_up_price(code)
         if limit_up_price != tool.to_price(decimal.Decimal(price)):
             # 闈炴定鍋滀环
-            return False
-
-        if volumn < 1:
-            return False
+            volumn = 0
         # 涓嶄繚瀛樺拰涓婁竴娆$浉鍚岀殑鏁版嵁
         if code in self.__last_data and self.__last_data[code] == volumn:
             return False

--
Gitblit v1.8.0