| | |
| | | return cls.__delegating_sell_num_dict.get(code) |
| | | |
| | | @classmethod |
| | | def set_deal_datas(cls, code, datas): |
| | | def set_deal_datas(cls, code, fdatas): |
| | | """ |
| | | 设置成交的卖单 |
| | | @param code: |
| | | @param datas: q.append((data['SecurityID'], data['TradePrice'], data['TradeVolume'],data['OrderTime'], data['MainSeq'], data['SubSeq'], data['BuyNo'],data['SellNo'], data['ExecType'])) |
| | | @param fdatas: 数据本身格式: (data['SecurityID'], data['TradePrice'], data['TradeVolume'],data['OrderTime'], data['MainSeq'], data['SubSeq'], data['BuyNo'],data['SellNo'], data['ExecType']) |
| | | [(数据本身, 是否主动买, 是否涨停, 总成交额, 不含ms时间,含ms时间)] |
| | | @return: 是否触发计算 |
| | | """ |
| | | try: |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | order_no_set = cls.__order_no_set_dict.get(code) |
| | | if order_no_set is None: |
| | | order_no_set = set() |
| | | limit_up_active_buy_datas = [] |
| | | for d in datas: |
| | | for d in fdatas: |
| | | # 是否有涨停主动买成交 |
| | | if d[6] < d[7]: |
| | | if not d[1]: |
| | | continue |
| | | if abs(d[1] - limit_up_price) > 0.001: |
| | | if not d[2]: |
| | | continue |
| | | limit_up_active_buy_datas.append(d) |
| | | total_deal_volume = 0 |
| | | if code in cls.__delegating_sell_num_dict: |
| | | for d in datas: |
| | | for d in fdatas: |
| | | # 减去 |
| | | if d[7] in order_no_set: |
| | | total_deal_volume += d[2] |
| | | if d[0][7] in order_no_set: |
| | | total_deal_volume += d[0][2] |
| | | cls.__delegating_sell_num_dict[code] -= total_deal_volume |
| | | |
| | | if len(limit_up_active_buy_datas): |
| | |
| | | f"涨停主动买成交:{limit_up_active_buy_datas}") |
| | | # 打印日志 |
| | | l2_log.info(code, hx_logger_l2_sell_deal, |
| | | f"有涨停主动卖:{code}-{datas[-1][3]}-{cls.__delegating_sell_num_dict.get(code)}, 成交量-{total_deal_volume}") |
| | | f"有涨停主动卖:{code}-{fdatas[-1][0][3]}-{cls.__delegating_sell_num_dict.get(code)}, 成交量-{total_deal_volume}") |
| | | except: |
| | | pass |
| | | |