| | |
| | | # 处理首板代码信息 |
| | | |
| | | import constant |
| | | import inited_data |
| | | from code_attribute import gpcode_manager, gpcode_first_screen_manager, code_nature_analyse, \ |
| | | code_volumn_manager |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | |
| | | from third_data.history_k_data_util import HistoryKDatasUtils |
| | | from ths import l2_code_operate |
| | | from trade import trade_data_manager, l2_trade_util |
| | | from utils import global_util, tool |
| | | from utils import global_util, tool, init_data_util |
| | | |
| | | __CodesPlateKeysManager = CodesHisReasonAndBlocksManager() |
| | | |
| | |
| | | # 获取涨停价 |
| | | _limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if not _limit_up_price: |
| | | inited_data.re_set_price_pres([code], True) |
| | | init_data_util.re_set_price_pres([code], True) |
| | | # 再次获取涨停价 |
| | | _limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if _limit_up_price: |
| | |
| | | for code in codes: |
| | | # 如果涨停价是空值就需要设置昨日收盘价格 |
| | | if gpcode_manager.get_limit_up_price(code) is None: |
| | | inited_data.re_set_price_pres([code], True) |
| | | init_data_util.re_set_price_pres([code], True) |
| | | |
| | | # 板块关键字准备 暂时删除 |
| | | # for code in codes: |
| | |
| | | if limit_up_price is None: |
| | | continue |
| | | try: |
| | | volumes_data = inited_data.get_volumns_by_code(code, 150) |
| | | volumes = inited_data.parse_max_volume(volumes_data[:90], |
| | | code_nature_analyse.is_new_top( |
| | | limit_up_price, |
| | | volumes_data[:90])) |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | volumes = init_data_util.parse_max_volume(volumes_data[:90], |
| | | code_nature_analyse.is_new_top( |
| | | limit_up_price, |
| | | volumes_data[:90])) |
| | | logger_first_code_record.info("{} 获取到首板60天最大量:{}", code, volumes) |
| | | code_volumn_manager.set_histry_volumn(code, volumes[0], volumes[1], volumes[2]) |
| | | |
| | |
| | | # 获取涨停价 |
| | | if temp_codes: |
| | | # 获取涨停价 |
| | | inited_data.re_set_price_pres(temp_codes) |
| | | init_data_util.re_set_price_pres(temp_codes) |
| | | # 重新获取涨停价 |
| | | for code in temp_codes: |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | |
| | | gpcode_manager.FirstCodeManager().add_limited_up_record([code]) |
| | | pricePre = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code) |
| | | if pricePre is None: |
| | | inited_data.re_set_price_pres([code]) |
| | | init_data_util.re_set_price_pres([code]) |
| | | |
| | | rate = round((float(price) - pricePre) * 100 / pricePre, 1) |
| | | prices.append( |
| | |
| | | logger_l2_codes_subscript.info(f"({request_id})l2代码相关数据加载完成") |
| | | return tick_datas |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code = "002308" |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | volumes_data = inited_data.get_volumns_by_code(code, 150) |
| | | # 保存K线形态 |
| | | k_format = code_nature_analyse.get_k_format(limit_up_price, volumes_data) |
| | | code_nature_analyse.CodeNatureRecordManager().save_k_format(code, k_format) |