| | |
| | | # 已经成交的累计大卖单金额:用于初次上板尚未订阅的情况 |
| | | __already_total_sell_deal_big_order_money = {} |
| | | __redis_manager = redis_manager.RedisManager(3) |
| | | # 临时大单阈值,初次上板使用: {"代码":(金额,更新时间)} |
| | | # 临时大单阈值,初次上板使用: {"代码":(金额,更新时间, 是否是默认的值)} |
| | | __temp_big_order_threshold = {} |
| | | |
| | | def __init__(self): |
| | |
| | | @param money_info_list: 成交的大买单:[(订单号,总股数,成交金额,成交开始时间,成交结束时间, 最近的成交价格, 最近的卖单号, 涨停价成交金额)] |
| | | @return: |
| | | """ |
| | | if code in self.__temp_big_order_threshold and time.time() < self.__temp_big_order_threshold[code][1]: |
| | | temp_big_order_threshold_info = self.__temp_big_order_threshold.get(code) |
| | | if temp_big_order_threshold_info and not temp_big_order_threshold_info[2] and time.time() < \ |
| | | self.__temp_big_order_threshold[code][1]: |
| | | return |
| | | if not money_info_list or len(money_info_list) < 2: |
| | | if not money_info_list or len(money_info_list) < 1: |
| | | return |
| | | fmoney_list = [] |
| | | min_money = l2_data_util.get_big_money_val(gpcode_manager.get_limit_up_price_as_num(code), |
| | |
| | | if info[7] >= min_money: |
| | | # 涨停价成交部分是大单 |
| | | fmoney_list.append((info[7], info[0])) |
| | | if len(fmoney_list) < 2: |
| | | if len(fmoney_list) < 1: |
| | | return |
| | | money_list = [x[0] for x in fmoney_list] |
| | | money_list = money_list[:2] |
| | | # 计算大单: 前2个大单的均值 |
| | | self.__temp_big_order_threshold[code] = (int(sum(money_list[:2]) // 2), time.time() + 10) |
| | | self.__temp_big_order_threshold[code] = ( |
| | | int(sum(money_list) // len(money_list)), time.time() + 10, len(money_list) < 2) |
| | | async_log_util.info(logger_l2_radical_buy_data, |
| | | f"首次上板临时买大单:{code}-{self.__temp_big_order_threshold[code]}-{fmoney_list[:2]}") |
| | | f"首次上板临时买大单:{code}-{self.__temp_big_order_threshold[code]}-{fmoney_list}") |
| | | trade_record_log_util.add_common_msg(code, "首封大单设置", f"{self.__temp_big_order_threshold[code][0]}") |
| | | |
| | | def get_temp_deal_big_order_threshold_info(self, code): |