From 545d65a4febc85d628aedf1547d6f9efebce34fd Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 23 四月 2024 17:20:01 +0800
Subject: [PATCH] 板上放小量不下单,加红撤单比例调整

---
 l2/l2_data_manager_new.py |   37 +++++++++++++++----------------------
 1 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py
index e6274b5..023fe07 100644
--- a/l2/l2_data_manager_new.py
+++ b/l2/l2_data_manager_new.py
@@ -942,28 +942,21 @@
             trade_price = current_price_process_manager.get_trade_price(code)
             if trade_price is None:
                 return False, True, f"灏氭湭鑾峰彇鍒板綋鍓嶆垚浜や环"
-            if False and float(limit_up_price) - float(trade_price) > 0.00001:
-                # 璁$畻淇″彿璧峰浣嶇疆鍒板綋鍓嶇殑鎵嬫暟
-                order_begin_pos = cls.__get_order_begin_pos(
-                    code)
-                num_operate_map = local_today_num_operate_map.get(code)
-                total_num = 0
-                for i in range(order_begin_pos.buy_single_index, total_data[-1]["index"] + 1):
-                    data = total_data[i]
-                    val = data["val"]
-                    if not L2DataUtil.is_limit_up_price_buy(val):
-                        continue
-                    left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code,
-                                                                                                             data[
-                                                                                                                 "index"],
-                                                                                                             total_data,
-                                                                                                             local_today_canceled_buyno_map.get(
-                                                                                                                 code))
-                    total_num += left_count * val["num"]
-                m_base_val = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code)
-                thresh_hold_num = m_base_val // (float(gpcode_manager.get_limit_up_price(code)) * 100)
-                if total_num < thresh_hold_num * 2:
-                    return False, False, f"褰撳墠鎴愪氦浠凤紙{trade_price}锛夊皻鏈湪0妗e強浠ュ唴 涓� 绾拱棰�({total_num})灏忎簬2鍊峂鍊�({thresh_hold_num * 2})"
+            # 鍒ゆ柇鏄惁涓烘澘涓婃斁閲忥細
+            # 1.褰撳墠鎴愪氦浠蜂负娑ㄥ仠浠�
+            # 2.鎬诲崠棰濅负0
+            if abs(float(limit_up_price) - float(trade_price)) < 0.001:
+                sell_data = cls.__L2MarketSellManager.get_current_total_sell_data(code)
+                if sell_data and sell_data[1]<=0:
+                    # 鏉夸笂鏀鹃噺锛屽垽鏂槸鍚︽湁鏀鹃噺锛屾斁閲忔墠浼氫笅鍗�
+                    # 鑾峰彇鏈�杩�1s鐨勪富鍔ㄥ崠閲戦
+                    min_time =  total_data[order_begin_pos.buy_single_index]['val']['time']
+                    min_time = tool.trade_time_add_second(min_time, -1)
+                    sell_orders = HuaXinSellOrderStatisticManager.get_latest_transaction_datas(code, min_deal_time=min_time)
+                    sell_order_num = sum([x[1] for x in sell_orders])
+                    sell_money = int(float(limit_up_price) * sell_order_num)
+                    if sell_money < 2990000:
+                        return False, False, f"鏉夸笂鏀鹃噺閲戦涓嶈冻锛岃繎1s鎬诲崠锛歿sell_money}灏忎簬299w"
             # 鍒ゆ柇鎴愪氦杩涘害鏄惁璺濈鎴戜滑鐨勪綅缃緢杩�
             trade_index, is_default = cls.__TradeBuyQueue.get_traded_index(code)
             if False and not is_default and trade_index:

--
Gitblit v1.8.0