| | |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from third_data import kpl_block_util, kpl_api, kpl_util, kpl_data_constant, huaxin_l1_data_manager |
| | | from settings.trade_setting import MarketSituationManager |
| | | from third_data.kpl_data_constant import LimitUpDataConstant |
| | | from third_data.kpl_data_constant import LimitUpDataConstant, LimitUpCodesBlockRecordManager |
| | | from third_data.third_blocks_manager import BlockMapManager, CodeThirdBlocksManager |
| | | from trade.buy_money_count_setting import RadicalBuyBlockCodeCountManager |
| | | from trade.order_statistic import DealAndDelegateWithBuyModeDataManager |
| | |
| | | @param code: |
| | | @return: 过滤后的板块,过滤前的板块 |
| | | """ |
| | | blocks = cls.get_code_kpl_blocks(code) |
| | | match_blocks, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks) |
| | | match_blocks -= constant.KPL_INVALID_BLOCKS |
| | | fblocks = match_blocks & RealTimeKplMarketData.get_top_market_jingxuan_blocks() |
| | | if not fblocks: |
| | | fblocks = set() |
| | | match_blocks_3, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks, same_count=3) |
| | | if match_blocks_3: |
| | | match_blocks_3 -= constant.KPL_INVALID_BLOCKS |
| | | fblocks |= match_blocks_3 |
| | | # 获取开盘啦历史涨停原因 |
| | | kpl_history_blocks = CodesHisReasonAndBlocksManager().get_history_blocks_cache(code) |
| | | if kpl_history_blocks: |
| | | fblocks |= BlockMapManager().filter_blocks(kpl_history_blocks) |
| | | jx_out_blocks = RealTimeKplMarketData.get_top_market_jingxuan_out_blocks() |
| | | if jx_out_blocks: |
| | | fblocks -= jx_out_blocks |
| | | # blocks = cls.get_code_kpl_blocks(code) |
| | | # match_blocks, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks) |
| | | # match_blocks -= constant.KPL_INVALID_BLOCKS |
| | | # fblocks = match_blocks & RealTimeKplMarketData.get_top_market_jingxuan_blocks() |
| | | # if not fblocks: |
| | | # fblocks = set() |
| | | # match_blocks_3, info = CodeThirdBlocksManager().get_intersection_blocks_info(code, blocks, same_count=3) |
| | | # if match_blocks_3: |
| | | # match_blocks_3 -= constant.KPL_INVALID_BLOCKS |
| | | # fblocks |= match_blocks_3 |
| | | # # 获取开盘啦历史涨停原因 |
| | | # kpl_history_blocks = CodesHisReasonAndBlocksManager().get_history_blocks_cache(code) |
| | | # if kpl_history_blocks: |
| | | # fblocks |= BlockMapManager().filter_blocks(kpl_history_blocks) |
| | | # jx_out_blocks = RealTimeKplMarketData.get_top_market_jingxuan_out_blocks() |
| | | # if jx_out_blocks: |
| | | # fblocks -= jx_out_blocks |
| | | # |
| | | # return fblocks, match_blocks |
| | | |
| | | return fblocks, match_blocks |
| | | # 新版本 |
| | | before_fblocks = LimitUpCodesBlockRecordManager().get_radical_buy_blocks(code) |
| | | if before_fblocks: |
| | | before_fblocks = set() |
| | | fblocks = BlockMapManager().filter_blocks(before_fblocks) |
| | | if fblocks: |
| | | fblocks -= constant.KPL_INVALID_BLOCKS |
| | | return fblocks, before_fblocks |
| | | |
| | | @classmethod |
| | | def is_radical_buy(cls, code, yesterday_limit_up_codes): |
| | |
| | | msges.append(f"【{b}】:{result[1]}") |
| | | fmsges.append("板块回封判断##" + ",".join(msges)) |
| | | |
| | | # 如果能扫入就需要获取代码在板块中的身位,此规则暂时不生效 |
| | | # 如果能扫入就需要获取代码在板块中的身位 |
| | | # if can_buy_blocks: |
| | | # excude_codes = set() |
| | | # if kpl_data_constant.open_limit_up_code_dict_for_radical_buy: |