From 97ec997e855faee25f8f2e35734f87afa5af6f95 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 27 八月 2024 17:15:21 +0800
Subject: [PATCH] 9:25之前的订阅数据处理

---
 l2/l2_transaction_data_processor.py |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/l2/l2_transaction_data_processor.py b/l2/l2_transaction_data_processor.py
index 95de9f2..055e9bb 100644
--- a/l2/l2_transaction_data_processor.py
+++ b/l2/l2_transaction_data_processor.py
@@ -13,6 +13,7 @@
 from l2.huaxin import l2_huaxin_util
 from l2.l2_data_manager import OrderBeginPosInfo
 from l2.l2_data_manager_new import L2TradeDataProcessor
+from l2.l2_data_util import L2DataUtil
 from l2.l2_transaction_data_manager import HuaXinBuyOrderManager, HuaXinSellOrderStatisticManager, BigOrderDealManager
 from log_module import async_log_util
 from log_module.log import hx_logger_l2_debug, logger_l2_trade_buy_queue, logger_debug, hx_logger_l2_upload
@@ -34,7 +35,9 @@
             d = datas[i]
             buy_no = f"{d[6]}"
             if buyno_map and buy_no in buyno_map:
-                buy_progress_index = buyno_map[buy_no]["index"]
+                # 鎴愪氦杩涘害浣嶅繀椤绘槸娑ㄥ仠涔�
+                if L2DataUtil.is_limit_up_price_buy(buyno_map[buy_no]["val"]):
+                    buy_progress_index = buyno_map[buy_no]["index"]
                 break
         return buy_progress_index
 
@@ -81,8 +84,7 @@
             limit_up_price = round(float(limit_up_price), 2)
         # 璁剧疆鎴愪氦浠�
         try:
-            current_price_process_manager.set_trade_price(code, datas[-1][1], l2_huaxin_util.convert_time(datas[-1][3]),
-                                                          limit_up_price)
+            current_price_process_manager.set_trade_price(code, datas[-1][1])
         except:
             pass
         total_datas = l2_data_util.local_today_datas.get(code)
@@ -98,6 +100,18 @@
 
             big_sell_order_info = None
             try:
+                # 缁熻涓婃澘鏃堕棿
+                try:
+                    for d in datas:
+                        if d[6] > d[7]:
+                            # 涓诲姩涔�
+                            if d[1] == limit_up_price:
+                                # 娑ㄥ仠
+                                current_price_process_manager.set_latest_not_limit_up_time(code,
+                                                                                           l2_huaxin_util.convert_time(
+                                                                                               d[3], with_ms=True))
+                except:
+                    pass
 
                 # 缁熻鍗栧崟
                 big_sell_order_info = HuaXinSellOrderStatisticManager.add_transaction_datas(code, datas, limit_up_price)
@@ -112,12 +126,13 @@
                     if need_cancel:
                         cancel_msg = f"S鎾�:{cancel_msg}"
                     if not need_cancel:
-                        need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code, big_sell_order_info,
+                        need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code,
                                                                                             order_begin_pos)
                     # 鍒ゆ柇鏃堕棿鏄惁涓庢湰鍦版椂闂寸浉宸�5s浠ヤ笂
                     if tool.trade_time_sub(tool.get_now_time_str(), l2_huaxin_util.convert_time(datas[-1][3])) > 10:
-                        need_cancel, cancel_msg = True, f"鎴愪氦鏃堕棿涓庢湰鍦版椂闂寸浉宸�10S浠ヤ笂锛寋l2_huaxin_util.convert_time(datas[-1][3])}"
-
+                        now_seconds = int(tool.get_now_time_str().replace(":", ""))
+                        if now_seconds < int("093200"):  # or int("130000") <= now_seconds < int("130200"):
+                            need_cancel, cancel_msg = True, f"鎴愪氦鏃堕棿涓庢湰鍦版椂闂寸浉宸�10S浠ヤ笂锛寋l2_huaxin_util.convert_time(datas[-1][3])}"
                     if need_cancel:
                         L2TradeDataProcessor.cancel_buy(code, cancel_msg)
 

--
Gitblit v1.8.0