From 78dabf7fdb1b33a1059eb605f9a209d95f1e5f57 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 07 一月 2025 15:50:58 +0800
Subject: [PATCH] 丰富订阅日志

---
 api/outside_api_command_callback.py |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py
index dd7c54d..48f7d20 100644
--- a/api/outside_api_command_callback.py
+++ b/api/outside_api_command_callback.py
@@ -36,7 +36,8 @@
     logger_trade, logger_trade_position_api_request, logger_request_api, \
     logger_real_place_order_position, logger_device
 from output import l2_output_util
-from third_data import kpl_util, history_k_data_manager, huaxin_l1_data_manager, third_blocks_manager, kpl_data_manager
+from third_data import kpl_util, history_k_data_manager, huaxin_l1_data_manager, third_blocks_manager, kpl_data_manager, \
+    history_k_data_util
 from third_data.code_plate_key_manager import KPLCodeJXBlockManager, RealTimeKplMarketData
 from third_data.history_k_data_manager import HistoryKDataManager
 from third_data.history_k_data_util import JueJinApi, HistoryKDatasUtils
@@ -48,7 +49,7 @@
 from trade import trade_manager, l2_trade_util, trade_data_manager, trade_constant
 import l2_data_util as l2_data_util_old
 from trade.buy_money_count_setting import BuyMoneyAndCountSetting, RadicalBuyBlockCodeCountManager
-from trade.buy_radical import block_special_codes_manager
+from trade.buy_radical import block_special_codes_manager, radical_buy_data_manager
 
 from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \
     huaxin_trade_record_manager, huaxin_trade_order_processor, huaxin_sell_util
@@ -487,7 +488,8 @@
         try:
             fdata = {}
             try:
-                date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10) ,tool.get_now_date_str())
+                date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10),
+                                                            tool.get_now_date_str())
                 if date:
                     fdata["juejin"] = 1
             except Exception as e:
@@ -544,13 +546,7 @@
 
             # 鑾峰彇浠婃棩K绾跨殑鏇存柊鏁伴噺
             try:
-                dates = HistoryKDatasUtils.get_latest_trading_date_cache(5)
-                logger_debug.info(f"鑾峰彇鍒扮殑浜ゆ槗鏃ワ細{dates}")
-                latest_trading_date = None
-                if dates:
-                    latest_trading_date = dates[0]
-                if latest_trading_date is None:
-                    raise Exception("娌℃湁鑾峰彇鍒颁笂涓�涓氦鏄撴棩鐨勬棩鏈�")
+                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}")
@@ -1352,7 +1348,7 @@
                 data = {
                     "radical_buy": {"price": (constant.MIN_CODE_RADICAL_BUY_PRICE, constant.MAX_CODE_RADICAL_BUY_PRICE),
                                     "zyltgb": constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES,
-                                    "top_block_count_by_market_strong":constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG,
+                                    "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
                                     }}
                 self.send_response({"code": 0, "data": data, "msg": f""},
@@ -1366,7 +1362,8 @@
                     constant.MAX_CODE_RADICAL_BUY_PRICE = radical_buy["price"][1]
                     constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES = radical_buy["zyltgb"]
                     if radical_buy.get("top_block_count_by_market_strong"):
-                        constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG = radical_buy.get("top_block_count_by_market_strong")
+                        constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG = radical_buy.get(
+                            "top_block_count_by_market_strong")
                     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")
@@ -1409,7 +1406,7 @@
                     fblocks, before_fblocks = RadicalBuyBlockManager.get_code_blocks(code)
                     # 鑾峰彇鏉垮潡鍘嗗彶娑ㄥ仠
                     for b in fblocks:
-                        codes =  LimitUpDataConstant.get_history_limit_up_block_codes(b)
+                        codes = LimitUpDataConstant.get_history_limit_up_block_codes(b)
                         if codes:
                             if code not in block_codes:
                                 block_codes[code] = {}
@@ -1418,6 +1415,16 @@
                                    client_id,
                                    request_id)
 
+            elif ctype == "test_place_order":
+                # 鑾峰彇鐩稿悓鏉垮潡鐨勬定鍋滀唬鐮佹暟閲�
+                code = data.get("code")
+                # total_datas = l2_data_util.local_today_datas.get(code)
+                # trade_manager.test_order(code, total_datas[-1], total_datas[-1]["index"])
+                # radical_buy_data_manager.pull_pre_deal_big_orders(code)
+                self.send_response({"code": 0, "data": {}},
+                                   client_id,
+                                   request_id)
+
 
 
         except Exception as e:

--
Gitblit v1.8.0