Administrator
2024-07-12 37f72b53cc2ef3ffb211c83e92b920318a5a89df
huaxin_client/l1_client.py
@@ -266,7 +266,8 @@
            list_ = [level1_data_dict[k] for k in level1_data_dict]
            flist = []
            plist = []
            threshold_rate = constant.L1_MIN_RATE_PRE if int(tool.get_now_time_str().replace(":", "")) < int(
            now_time_int = int(tool.get_now_time_str().replace(":", ""))
            threshold_rate = constant.L1_MIN_RATE_PRE if now_time_int < int(
                "094000") else constant.L1_MIN_RATE
            for d in list_:
                if d[2] >= threshold_rate:
@@ -275,7 +276,13 @@
                if d[0] in __position_codes:
                    plist.append(d)
            flist.sort(key=lambda x: x[2], reverse=True)
            datas = flist[:1000]
            # 正式交易之前先处理比较少的数据,不然处理时间久造成数据拥堵
            MAX_COUNT = 1000
            if now_time_int < int("092600"):
                MAX_COUNT = 100
            elif now_time_int < int("092800"):
                MAX_COUNT = 200
            datas = flist[:MAX_COUNT]
            # 将持仓股加入进去
            datas.extend(plist)
            if len(datas) > 0: