| | |
| | | from l2 import l2_data_manager_new |
| | | from l2.huaxin import huaxin_target_codes_manager |
| | | from log_module.log import logger_system, logger_l2_codes_subscript |
| | | from third_data import block_info |
| | | from third_data import block_info, kpl_api |
| | | from third_data.code_plate_key_manager import KPLCodeJXBlockManager |
| | | from third_data.history_k_data_util import HistoryKDatasUtils, JueJinApi |
| | | from third_data.kpl_data_manager import KPLDataManager |
| | |
| | | print("时间戳:", times) |
| | | print("内容:", datas) |
| | | # 只处理20s内的数据 |
| | | if time.time() - times < 20 and datas: |
| | | if time.time() - times < 20: |
| | | # 获取涨停列表中的数据 |
| | | # datas中的数据格式:(代码, 现价, 涨幅, 量, 时间) |
| | | codes = [d[0] for d in datas] |
| | | # 9:25-9:30之间获取 |
| | | if int("092500") < int(tool.get_now_time_str().replace(":", "")) < int("092955"): |
| | | try: |
| | | limit_up_data_str = kpl_api.getLimitUpInfo() |
| | | limit_up_datas = json.loads(limit_up_data_str) |
| | | for d in limit_up_datas: |
| | | code = d[0] |
| | | if code in codes: |
| | | continue |
| | | if not tool.is_shsz_code(code): |
| | | continue |
| | | limit_up_price = gpcode_manager.get_limit_up_price(d[0]) |
| | | if limit_up_price: |
| | | # 默认设置涨停,量为0 |
| | | datas.append((code, float(limit_up_price), 10, 0, time.time())) |
| | | except Exception as e: |
| | | logger_l2_codes_subscript.exception(e) |
| | | if not datas: |
| | | # 没有数据需要处理 |
| | | continue |
| | | |
| | | # 再次获取代码 |
| | | codes = [d[0] for d in datas] |
| | | for code in codes: |
| | | block_info.init_code(code) |