| | |
| | | import time |
| | | import concurrent.futures |
| | | |
| | | from huaxin_client import l1_subscript_codes_manager |
| | | from huaxin_client import l1_subscript_codes_manager |
| | | from huaxin_client import constant |
| | | import lev2mdapi |
| | | from huaxin_client.l2_data_manager import L2DataUploadManager |
| | | from log_module.async_log_util import huaxin_l2_log |
| | | from log_module.log import logger_local_huaxin_l2_subscript, logger_system, logger_l2_codes_subscript, hx_logger_l2_market_data |
| | | from log_module.log import logger_local_huaxin_l2_subscript, logger_system, logger_l2_codes_subscript, \ |
| | | hx_logger_l2_market_data_before_open |
| | | from utils import tool |
| | | |
| | | ###B类### |
| | |
| | | tool.to_price(decimal.Decimal(str(pDepthMarketData['PreClosePrice'])) * decimal.Decimal("1.1"))) |
| | | if abs(limit_up_price - pDepthMarketData['LastPrice']) < 0.001 or abs( |
| | | limit_up_price - pDepthMarketData['BidPrice1']) < 0.001: |
| | | huaxin_l2_log.info(hx_logger_l2_market_data, f"{d}") |
| | | huaxin_l2_log.info(hx_logger_l2_market_data_before_open, f"{d}") |
| | | self.__limit_up_codes.add(pDepthMarketData['SecurityID']) |
| | | else: |
| | | self.__limit_up_codes.discard(pDepthMarketData['SecurityID']) |
| | | if pDepthMarketData.SecurityID in self.__limit_up_codes: |
| | | market_code_dict[pDepthMarketData.SecurityID] = ( |
| | | pDepthMarketData.SecurityID, pDepthMarketData.LastPrice, 0.1, pDepthMarketData.TotalBidVolume, |
| | | pDepthMarketData.SecurityID, pDepthMarketData.BidPrice1, 0.1, pDepthMarketData.TotalBidVolume, |
| | | time.time(), |
| | | pDepthMarketData.BidPrice1, pDepthMarketData.BidVolume1) |
| | | else: |
| | |
| | | market_code_dict.pop(pDepthMarketData.SecurityID) |
| | | |
| | | if limit_up_count != len(self.__limit_up_codes): |
| | | huaxin_l2_log.info(hx_logger_l2_market_data, f"涨停代码:{self.__limit_up_codes}") |
| | | huaxin_l2_log.info(hx_logger_l2_market_data_before_open, f"涨停代码:{self.__limit_up_codes}") |
| | | except: |
| | | pass |
| | | |
| | |
| | | |
| | | pipe_strategy = None |
| | | |
| | | |
| | | |
| | | __latest_subscript_codes = set() |
| | | |
| | | |
| | | def __upload_codes_info(queue_l1_w_strategy_r: multiprocessing.Queue, datas): |
| | | if not tool.is_trade_time(): |
| | | return |
| | |
| | | for c in codes: |
| | | __latest_subscript_codes.add(c) |
| | | if add_codes: |
| | | hx_logger_l2_market_data.info(f"({request_id})新增加订阅的代码:{add_codes}") |
| | | hx_logger_l2_market_data_before_open.info(f"({request_id})新增加订阅的代码:{add_codes}") |
| | | |
| | | |
| | | def run(queue_l1_w_strategy_r) -> None: |
| | | logger_system.info("L2进程ID:{}", os.getpid()) |