From d2a4dd9c837f8df2a19e58f7fb4c81a91c114b67 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 15 八月 2025 13:15:32 +0800
Subject: [PATCH] 自动加想接口

---
 trade/auto_add_want_buy_strategy.py |    4 ++++
 api/outside_api_command_callback.py |    6 +++++-
 constant.py                         |    3 +++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py
index a075fdc..f6e6402 100644
--- a/api/outside_api_command_callback.py
+++ b/api/outside_api_command_callback.py
@@ -1438,7 +1438,8 @@
                                     "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL,
                                     "ignore_block_in_money_market_strong": constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG,
                                     "buy_first_limit_up": 1 if constant.CAN_BUY_FIRST_LIMIT_UP else 0,
-                                    "can_auto_add_white": 1 if constant.CAN_AUTO_ADD_WHITE else 0
+                                    "can_auto_add_white": 1 if constant.CAN_AUTO_ADD_WHITE else 0,
+                                    "can_auto_add_want_buy_codes": 1 if constant.CAN_AUTO_ADD_WANT_BUY_CODES else 0
                                     }}
                 self.send_response({"code": 0, "data": data, "msg": f""},
                                    client_id,
@@ -1465,6 +1466,9 @@
                     if radical_buy.get('can_auto_add_white') is not None:
                         constant.CAN_AUTO_ADD_WHITE = True if radical_buy.get(
                             'can_auto_add_white') else False
+                    if radical_buy.get('can_auto_add_want_buy_codes') is not None:
+                        constant.CAN_AUTO_ADD_WANT_BUY_CODES = True if radical_buy.get(
+                            'can_auto_add_want_buy_codes') else False
 
                 self.send_response({"code": 0, "data": {}, "msg": f""},
                                    client_id,
diff --git a/constant.py b/constant.py
index 9ee0835..4de827d 100644
--- a/constant.py
+++ b/constant.py
@@ -242,4 +242,7 @@
 # L鍚庢挙鍗曢槇鍊煎彉澶ф闀�
 L_DOWN_RATE_INCREASE_STEP = 0.1
 
+# 鍙互鑷姩鍔犳兂
+CAN_AUTO_ADD_WANT_BUY_CODES = True
+
 
diff --git a/trade/auto_add_want_buy_strategy.py b/trade/auto_add_want_buy_strategy.py
index 541bde5..523e24c 100644
--- a/trade/auto_add_want_buy_strategy.py
+++ b/trade/auto_add_want_buy_strategy.py
@@ -3,6 +3,8 @@
 """
 import time
 
+import constant
+
 from code_attribute import gpcode_manager, code_nature_analyse
 from code_attribute.code_volumn_manager import CodeVolumeManager
 from log_module.log import logger_debug
@@ -19,6 +21,8 @@
         try:
             if not tool.is_trade_time():
                 continue
+            if not constant.CAN_AUTO_ADD_WANT_BUY_CODES:
+                continue
             excute()
         except Exception as e:
             logger_debug.exception(e)

--
Gitblit v1.8.0