code_attribute/first_target_code_data_processor.py | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
servers/huaxin_trade_api_server.py | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
trade/current_price_process_manager.py | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
code_attribute/first_target_code_data_processor.py
@@ -10,6 +10,7 @@ from code_attribute.code_data_util import ZYLTGBUtil from code_attribute.code_nature_analyse import HighIncreaseCodeManager from code_attribute.gpcode_manager import WantBuyCodesManager from log_module import async_log_util 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 @@ -183,7 +184,7 @@ logger_first_code_record.error(f"{request_id}-{code}:{str(e)}") logger_first_code_record.exception(e) logger_l2_codes_subscript.info(f"{request_id}加载l2代码K线结束") async_log_util.info(logger_l2_codes_subscript, f"{request_id}加载l2代码K线结束") gpcode_manager.FirstCodeManager().add_record(codes) # 初始化板块信息,暂时删除 @@ -259,5 +260,5 @@ "limit_up": is_limit_up}) gpcode_first_screen_manager.process_ticks(prices) logger_l2_codes_subscript.info(f"({request_id})l2代码相关数据加载完成") async_log_util.info(logger_l2_codes_subscript, f"({request_id})l2代码相关数据加载完成") return tick_datas servers/huaxin_trade_api_server.py
@@ -435,32 +435,10 @@ datas = _datas[1] request_id = _datas[2] logger_l2_codes_subscript.info("({})读取L2代码处理队列:数量-{}", request_id, len(datas)) print("时间戳:", times) print("内容:", datas) # 只处理20s内的数据 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.getLimitUpInfoNew() limit_up_datas = json.loads(limit_up_data_str) limit_up_datas = limit_up_datas["list"] for d in limit_up_datas: code = d[0] if code in codes: continue if not tool.is_can_buy_code(code): continue limit_up_price = gpcode_manager.get_limit_up_price(d[0]) if limit_up_price: # 默认设置涨停,量为0 datas.append((code, 0, float(limit_up_price), tool.get_shadow_price(float(limit_up_price)), 100)) except Exception as e: logger_l2_codes_subscript.exception(e) if not datas: # 没有数据需要处理 continue @@ -472,9 +450,8 @@ root_data = {"type": ClientSocketManager.CLIENT_TYPE_CMD_L2, "data": datas} queue_other_w_l2_r.put_nowait(json.dumps(root_data)) print("设置L2代码结束") # 如果在9:24-9:30 需要加载板块 if int("092400") < int(tool.get_now_time_str().replace(":", "")) < int("093000"): # 如果在9:24-9:29 需要加载板块 if int("092400") < int(tool.get_now_time_str().replace(":", "")) < int("092900"): for d in datas: threading.Thread(target=lambda: KPLCodeJXBlockManager().load_jx_blocks(d[0], gpcode_manager.get_price( @@ -482,7 +459,7 @@ float(d[2]), KPLLimitUpDataRecordManager.get_current_reasons()), daemon=True).start() time.sleep(1) time.sleep(0.2) logger_l2_codes_subscript.info("({})发送到华鑫L2代码处理队列:数量-{}", request_id, len(datas)) except Exception as e: logging.exception(e) trade/current_price_process_manager.py
@@ -112,7 +112,6 @@ # dif2 = add_code_set - latest_add_codes # if dif1 or dif2: if True: print("设置L2代码数量:", len(add_code_set)) global latest_add_codes async_log_util.info(logger_l2_codes_subscript, f"({request_id})预处理新增订阅代码:{add_code_set - latest_add_codes}") @@ -157,8 +156,6 @@ free_count += 1 if free_count > 2: break print(add_code_list, del_code_list) __trade_price_dict = {}