From 64e7f086c38401b061b8fe6a70a376857a8fa01f Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期三, 26 三月 2025 11:01:19 +0800
Subject: [PATCH] bug修复

---
 api/outside_api_command_callback.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py
index 29f3894..33e1218 100644
--- a/api/outside_api_command_callback.py
+++ b/api/outside_api_command_callback.py
@@ -14,7 +14,7 @@
 import constant
 import inited_data
 import outside_api_command_manager
-from cancel_strategy.s_l_h_cancel_strategy import SCancelBigNumComputer
+from cancel_strategy.s_l_h_cancel_strategy import SCancelBigNumComputer, LCancelRateManager
 from code_attribute import gpcode_manager, code_volumn_manager, zyltgb_util
 from code_attribute.code_data_util import ZYLTGBUtil
 from code_attribute.code_l1_data_manager import L1DataManager
@@ -292,6 +292,7 @@
             fresult = {"code": 0}
             if code_list_type == outside_api_command_manager.CODE_LIST_WANT:
                 if operate == outside_api_command_manager.OPERRATE_SET:
+                    trade_record_log_util.add_want_buy(code)
                     gpcode_manager.WantBuyCodesManager().add_code(code)
                     if l2_trade_util.is_in_forbidden_trade_codes(code):
                         l2_trade_util.remove_from_forbidden_trade_codes(code)
@@ -303,6 +304,7 @@
                         if results:
                             gpcode_manager.CodesNameManager.add_first_code_name(code, results[code])
                 elif operate == outside_api_command_manager.OPERRATE_DELETE:
+                    trade_record_log_util.remove_want_buy(code)
                     gpcode_manager.WantBuyCodesManager().remove_code(code)
                 elif operate == outside_api_command_manager.OPERRATE_GET:
                     codes = gpcode_manager.WantBuyCodesManager().list_code_cache()
@@ -550,10 +552,8 @@
                 latest_trading_date = history_k_data_util.get_k_bar_dead_date()
                 codes = HistoryKDataManager().get_history_bars_codes(latest_trading_date)
                 count = len(codes)
-                logger_debug.info(f"K绾夸唬鐮佹暟閲忥細{count}")
                 fdata["today_history_k_bar_count"] = count
             except Exception as e:
-                logger_debug.exception(e)
                 fdata["today_history_k_bar_count"] = -1
 
             # 鑾峰彇鏁版嵁鏈嶅姟鍣ㄦ槸鍚﹁仈閫�
@@ -1062,6 +1062,8 @@
                                             break
                             except:
                                 pass
+                            # L鎾ゆ瘮渚�
+                            l_down_cancel_rate, must_buy = LCancelRateManager.get_cancel_rate(code, buy_mode = OrderBeginPosInfo.MODE_RADICAL)
                             fdata = {"id": orderSysID, "code_info": (code, code_name), "total_num": total_nums,
                                      "finish_num": deal_or_cancel_num,
                                      "buy1_money": output_util.money_desc(buy1_money),
@@ -1084,7 +1086,8 @@
                                      "limit_up_price": gpcode_manager.get_limit_up_price_as_num(code),
                                      "is_near_big_order": is_near_big_order,
                                      "block": '',
-                                     "trade_queue": []
+                                     "trade_queue": [],
+                                     "l_down_cancel_rate":l_down_cancel_rate
                                      }
                             limit_up_data = kpl_data_manager.KPLLimitUpDataRecordManager.record_code_dict.get(code)
                             # 鑾峰彇褰撳墠鏉垮潡
@@ -1351,7 +1354,7 @@
                                     "zyltgb": constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES,
                                     "top_block_count_by_market_strong": constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG,
                                     "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL,
-                                    "ignore_block_in_money":constant.IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG
+                                    "ignore_block_in_money_market_strong":constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG
                                     }}
                 self.send_response({"code": 0, "data": data, "msg": f""},
                                    client_id,
@@ -1369,8 +1372,8 @@
                     if radical_buy.get("special_codes_max_block_in_rank"):
                         constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL = radical_buy.get(
                             "special_codes_max_block_in_rank")
-                    if radical_buy.get('ignore_block_in_money') is not None:
-                        constant.IS_IGNORE_BLOCK_IN_MONEY_WITH_MARKET_STRONG = radical_buy.get('ignore_block_in_money')
+                    if radical_buy.get('ignore_block_in_money_market_strong') is not None:
+                        constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG = radical_buy.get('ignore_block_in_money_market_strong')
                 self.send_response({"code": 0, "data": {}, "msg": f""},
                                    client_id,
                                    request_id)

--
Gitblit v1.8.0