Administrator
2025-02-20 05c1607c84af32a9cf77a9f47710db76ccbc61ec
排1准备
2个文件已修改
11 ■■■■ 已修改文件
huaxin_client/l2_market_client.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
servers/huaxin_trade_server.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/l2_market_client.py
@@ -169,7 +169,8 @@
            limit_up_count = len(self.__limit_up_codes)
            # 获取是否涨停价
            limit_up_price = float(
                tool.to_price(decimal.Decimal(str(pDepthMarketData['PreClosePrice'])) * decimal.Decimal(tool.get_limit_up_rate(pDepthMarketData['SecurityID']))))
                tool.to_price(decimal.Decimal(str(pDepthMarketData['PreClosePrice'])) * decimal.Decimal(
                    tool.get_limit_up_rate(pDepthMarketData['SecurityID']))))
            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_before_open, f"{d}")
@@ -180,7 +181,8 @@
                market_code_dict[pDepthMarketData.SecurityID] = (
                    pDepthMarketData.SecurityID, pDepthMarketData.BidPrice1, 0.1, pDepthMarketData.TotalBidVolume,
                    time.time(),
                    pDepthMarketData.BidPrice1, pDepthMarketData.BidVolume1)
                    pDepthMarketData.BidPrice1, pDepthMarketData.BidVolume1, pDepthMarketData.BidPrice2,
                    pDepthMarketData.BidVolume2, pDepthMarketData.UpdateTime, pDepthMarketData.PreClosePrice)
            else:
                if pDepthMarketData.SecurityID in market_code_dict:
                    market_code_dict.pop(pDepthMarketData.SecurityID)
servers/huaxin_trade_server.py
@@ -322,13 +322,16 @@
    def __process_buy_open_limit_up_datas(cls, datas):
        """
        处理排1的数据
        @param datas: [(代码, 现价, 涨幅, 量, 当前时间, 买1价, 买1量, 买2价, 买2量, 更新时间)]
        @param datas: [(代码, 现价, 涨幅, 量, 当前时间, 买1价, 买1量, 买2价, 买2量, 更新时间, 昨日收盘价(集合竞价才有))]
        @return:
        """
        # 9:25之后不再处理
        if tool.get_now_time_as_int() > int("092500"):
            return
        for d in datas:
            # 计算当前是否是涨停状态
            if len(d)==11:
                async_log_util.info(logger_debug, f"开1数据:{d}")
            if gpcode_manager.BuyOpenLimitUpCodeManager().is_in_cache(d[0]):
                # 09:19:50 到 09:20:00判断是否要撤单
                if int("091950") <= int(d[9].replace(":", "")) < int("092000"):