From 6bbfbbb16d792f7737ec86cabdba5c0e98dcf4b4 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 29 八月 2025 17:41:29 +0800 Subject: [PATCH] 有涨停买撤单要触发撤单计算 --- api/outside_api_command_callback.py | 36 +++++++++++++++++++++++++++++------- 1 files changed, 29 insertions(+), 7 deletions(-) diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py index a0799c8..ce05a22 100644 --- a/api/outside_api_command_callback.py +++ b/api/outside_api_command_callback.py @@ -20,7 +20,7 @@ from code_attribute.code_data_util import ZYLTGBUtil from code_attribute.code_l1_data_manager import L1DataManager from code_attribute.gpcode_manager import CodePrePriceManager, CodesNameManager, WantBuyCodesManager, \ - HumanRemoveForbiddenManager, HumanForbiddenManager + HumanRemoveForbiddenManager, HumanForbiddenManager, CodesContinueBuyMoneyManager from db import mysql_data_delegate as mysql_data, redis_manager_delegate as redis_manager from db.redis_manager_delegate import RedisUtils from huaxin_client import l1_subscript_codes_manager @@ -60,7 +60,7 @@ from trade.sell import sell_manager from trade.sell.sell_rule_manager import TradeRuleManager, SellRule from trade.trade_data_manager import RadicalBuyDealCodesManager -from trade.trade_manager import TradeTargetCodeModeManager, AutoCancelSellModeManager, CodesContinueBuyMoneyManager, \ +from trade.trade_manager import TradeTargetCodeModeManager, AutoCancelSellModeManager, \ CodesTradeStateManager from settings.trade_setting import MarketSituationManager, TradeBlockBuyModeManager from utils import socket_util, data_export_util, tool, huaxin_util, output_util, global_util, init_data_util @@ -290,8 +290,8 @@ code_list_type = data["code_list_type"] operate = data["operate"] code = data.get("code") - if code and not tool.is_can_buy_code(code): - raise Exception(f"涓嶆槸鍙互浜ゆ槗鐨勪唬鐮侊細{code}") + # if code and not tool.is_can_buy_code(code): + # raise Exception(f"涓嶆槸鍙互浜ゆ槗鐨勪唬鐮侊細{code}") fresult = {"code": 0} if code_list_type == outside_api_command_manager.CODE_LIST_WANT: if operate == outside_api_command_manager.OPERRATE_SET: @@ -1032,7 +1032,8 @@ except Exception as e: logger_debug.exception(e) - result = {"code": 0, "data": {"account_available_money": account_available_money, "delegates": fdatas, "rate_of_increase_step": constant.L_DOWN_RATE_INCREASE_STEP}} + result = {"code": 0, "data": {"account_available_money": account_available_money, "delegates": fdatas, + "rate_of_increase_step": constant.L_DOWN_RATE_INCREASE_STEP}} self.send_response(result, client_id, request_id) elif ctype == "get_delegated_buy_code_infos_v2": account_available_money = trade_data_manager.AccountMoneyManager().get_available_money_cache() @@ -1194,6 +1195,8 @@ async_log_util.info(logger_debug, f"缁熻瀹炴挙鐢ㄦ椂锛歿code} - {use_time}") except Exception as e: logger_debug.exception(e) + fdata["volume_info"] = code_volumn_manager.CodeVolumeManager().get_volume_rate(code, + with_info=True) fdatas.append(fdata) except Exception as e: logger_debug.exception(e) @@ -1439,7 +1442,9 @@ "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_want_buy_codes": 1 if constant.CAN_AUTO_ADD_WANT_BUY_CODES else 0 + "can_auto_add_want_buy_codes": 1 if constant.CAN_AUTO_ADD_WANT_BUY_CODES else 0, + "can_auto_l_down_rate_change": 1 if constant.CAN_AUTO_L_DOWN_RATE_CHANGE else 0, + "auto_add_want_buy_codes_time_ranges": constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES }} self.send_response({"code": 0, "data": data, "msg": f""}, client_id, @@ -1469,6 +1474,15 @@ 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 + + if radical_buy.get('can_auto_l_down_rate_change') is not None: + constant.CAN_AUTO_L_DOWN_RATE_CHANGE = True if radical_buy.get( + 'can_auto_l_down_rate_change') else False + + if radical_buy.get('auto_add_want_buy_codes_time_ranges') is not None: + time_ranges = radical_buy.get('auto_add_want_buy_codes_time_ranges') + constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES = ( + time_ranges.split(",")[0], time_ranges.split(",")[1]) self.send_response({"code": 0, "data": {}, "msg": f""}, client_id, @@ -1574,11 +1588,19 @@ # if rate < old_rate: # 鏀瑰皬鎵嶈兘閲嶆柊鍥婃嫭 trade_record_log_util.add_common_msg(code, "L鍚庨噸鏂板泭鎷�", msg=f"淇敼鎾ゅ崟姣斾緥: {old_rate}->{rate}") - LCancelBigNumComputer().re_compute_l_down_watch_indexes(code, is_force=True) + LCancelBigNumComputer().re_compute_l_down_watch_indexes(code, is_force=True, is_human=True) self.send_response({"code": 0, "data": {}}, client_id, request_id) + elif ctype == "remove_l_down_rate": + # 鍒犻櫎L鍚庢挙鍗曟瘮渚� + code = data.get("code") + CancelRateHumanSettingManager().remove_l_down(code) + trade_record_log_util.add_common_msg(code, "鍒犻櫎L鍚庨璁炬瘮渚�") + self.send_response({"code": 0, "data": {}}, + client_id, + request_id) elif ctype == "get_continue_buy_info": # 璁剧疆L鍚庢挙鍗曟瘮渚� -- Gitblit v1.8.0