From 781aa4e0af5a29d39c63f022404e93570248c5b9 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 28 十一月 2023 14:42:58 +0800 Subject: [PATCH] 精选板块获取修改 --- l2/l2_data_manager_new.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 59a674d..21cc71f 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -633,6 +633,11 @@ try: jx_blocks, jx_blocks_by = KPLCodeJXBlockManager().get_jx_blocks_cache( code), KPLCodeJXBlockManager().get_jx_blocks_cache(code, by=True) + if jx_blocks: + jx_blocks = jx_blocks[0] + if jx_blocks_by: + jx_blocks_by = jx_blocks_by[0] + info = cls.__trade_log_placr_order_info_dict[code] info.mode = order_begin_pos.mode info.set_buy_index(order_begin_pos.buy_single_index, order_begin_pos.buy_exec_index) @@ -935,7 +940,7 @@ # 鑾峰彇褰撳墠绁ㄧ殑娑ㄥ仠鍘熷洜 if code in LimitUpCodesPlateKeyManager.today_total_limit_up_reason_dict: limit_up_reason = kpl_data_manager.KPLLimitUpDataRecordManager.get_current_block(code) - if limit_up_reason not in constant.KPL_INVALID_BLOCKS: + if limit_up_reason and limit_up_reason not in constant.KPL_INVALID_BLOCKS: # 鍒ゆ柇鏄惁鏄嫭鑻� codes = kpl_data_manager.KPLLimitUpDataRecordManager.get_current_codes_by_block(limit_up_reason) if codes: @@ -1009,7 +1014,7 @@ return False, True, "灏氭湭鑾峰彇鍒版澘鍧椾俊鎭�" if can_buy_result[1]: - if cls.volume_rate_info[code][0] < 0.6: + if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6: return False, True, f"鐙嫍锛氶噺姣旓紙{cls.volume_rate_info[code][0]}锛夋湭杈惧埌60%" # 鑾峰彇K绾垮舰鎬侊紝鍒ゆ柇鏄惁杩�2澶╂槸鍚︿负10澶╁唴鏈�澶ч噺 -- Gitblit v1.8.0