From 25eb363dfa7fcd21fe85f70434e80c787cab5e12 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 17 四月 2025 11:19:16 +0800 Subject: [PATCH] 订阅bug解决 --- trade/current_price_process_manager.py | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/trade/current_price_process_manager.py b/trade/current_price_process_manager.py index a09ba7e..c1e6ad8 100644 --- a/trade/current_price_process_manager.py +++ b/trade/current_price_process_manager.py @@ -17,6 +17,7 @@ from trade.buy_radical import radical_buy_data_manager, new_block_processor from trade.buy_radical.block_special_codes_manager import BlockSpecialCodesManager from trade.buy_radical.radical_buy_data_manager import RadicalBuyBlockManager, RadicalBuyDataManager +from trade.order_statistic import DealAndDelegateWithBuyModeDataManager from utils import tool, import_util from trade import trade_manager, l2_trade_util, trade_constant from trade.trade_data_manager import CodeActualPriceProcessor, RadicalBuyDealCodesManager @@ -31,7 +32,8 @@ latest_add_codes = set() -def compute_code_order(code, top_in_blocks=None, yesterday_limit_up_codes=None, today_history_limit_up_codes=None, top_out_blocks=None): +def compute_code_order(code, top_in_blocks=None, yesterday_limit_up_codes=None, today_history_limit_up_codes=None, + top_out_blocks=None): """ 璁$畻浠g爜鐨勬帓搴� @param code: @@ -52,7 +54,9 @@ return -1 # 榛戝悕鍗� trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(code) - + # 澶勪簬濮旀墭鐘舵�佺殑蹇呴』璁㈤槄 + if trade_state == trade_constant.TRADE_STATE_BUY_DELEGATED or trade_state == trade_constant.TRADE_STATE_BUY_PLACE_ORDER: + return 0 if l2_trade_util.is_in_forbidden_trade_codes(code): # 娌℃湁鎴愪氦 if trade_state == trade_constant.TRADE_STATE_BUY_SUCCESS: @@ -60,14 +64,13 @@ return 998 else: return -1 - deal_codes = RadicalBuyDealCodesManager().get_deal_codes() result = RadicalBuyDataManager().is_code_can_buy(code, deal_codes) if not result[0]: if len(result) > 2 and result[2]: # 鍙互鎷夐粦 if new_block_processor.is_can_forbidden(code): - l2_trade_util.forbidden_trade(code, msg = result[1]) + l2_trade_util.forbidden_trade(code, msg=result[1]) return -1 # 鎯充拱鍗� @@ -132,7 +135,8 @@ # 鍒ゆ柇浠婃棩杈ㄨ瘑搴� try: for b in blocks: - if radical_buy_data_manager.RadicalBuyBlockManager.is_today_block_special_codes(code, b, yesterday_limit_up_codes): + if radical_buy_data_manager.RadicalBuyBlockManager.is_today_block_special_codes(code, b, + yesterday_limit_up_codes): if b in top_in_blocks: index = top_in_blocks.index(b) return index + 1 @@ -200,7 +204,8 @@ _delete_list = [] for item in new_code_list: trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(item[1]) - if l2_trade_util.is_in_forbidden_trade_codes(item[1]) and trade_state != trade_constant.TRADE_STATE_BUY_SUCCESS: + if l2_trade_util.is_in_forbidden_trade_codes( + item[1]) and trade_state != trade_constant.TRADE_STATE_BUY_SUCCESS: # 鎷夐粦鐨勫皻鏈垚浜ょ殑浠g爜 _delete_list.append(item) elif item[0] < 0: -- Gitblit v1.8.0