| | |
| | | from code_attribute.gpcode_manager import WantBuyCodesManager |
| | | from log_module.log import logger_first_code_record, logger_l2_codes_subscript |
| | | from third_data.code_plate_key_manager import CodesHisReasonAndBlocksManager |
| | | from third_data.history_k_data_manager import HistoryKDataManager |
| | | from third_data.history_k_data_util import HistoryKDatasUtils, JueJinApi |
| | | from ths import l2_code_operate |
| | | from trade import trade_data_manager, l2_trade_util |
| | |
| | | def process_first_codes_datas(dataList, request_id=None): |
| | | logger_l2_codes_subscript.info(f"{request_id}加载l2代码相关数据") |
| | | # 获取最近5天的交易日期,为后面的数据计算做准备 |
| | | HistoryKDatasUtils.get_latest_trading_date_cache(5) |
| | | dates = HistoryKDatasUtils.get_latest_trading_date_cache(5) |
| | | latest_trading_date = None |
| | | if dates: |
| | | latest_trading_date = dates[0] |
| | | |
| | | limit_up_price_dict = {} |
| | | temp_codes = [] |
| | | codes = [] |
| | |
| | | if limit_up_price is None: |
| | | continue |
| | | try: |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | # 首先从缓存里面获取 |
| | | volumes_data = None |
| | | if latest_trading_date: |
| | | volumes_data = HistoryKDataManager().get_history_bars(code, latest_trading_date) |
| | | if not volumes_data: |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | volumes = init_data_util.parse_max_volume(code, volumes_data[:90], |
| | | code_nature_analyse.is_new_top(code, |
| | | limit_up_price, |
| | |
| | | l2_trade_util.forbidden_trade(code, |
| | | f"无辨识度,涨停价({limit_up_price})>50") |
| | | continue |
| | | if code_nature_analyse.is_price_too_high_in_days(code, volumes_data, limit_up_price)[0] and code.find("30")!=0: |
| | | if code_nature_analyse.is_price_too_high_in_days(code, volumes_data, limit_up_price)[ |
| | | 0] and code.find("30") != 0: |
| | | # 判断是否太高 |
| | | l2_trade_util.forbidden_trade(code, "6天内股价长得太高") |
| | | continue |