| | |
| | | @classmethod |
| | | def add_transaction_datas(cls, code, datas, buy_exec_index=None): |
| | | # 是否为主动卖 |
| | | def is_active_sell(sell_no): |
| | | if buy_exec_index is not None: |
| | | return sell_no > int(total_datas[buy_exec_index]["val"]["orderNo"]) |
| | | else: |
| | | return f"{sell_no}" not in sell_no_map |
| | | def is_active_sell(sell_no, buy_no): |
| | | return sell_no > buy_no |
| | | |
| | | # q.append((data['SecurityID'], data['TradePrice'], data['TradeVolume'], |
| | | # data['OrderTime'], data['MainSeq'], data['SubSeq'], data['BuyNo'], |
| | |
| | | if not sell_no_map: |
| | | sell_no_map = {} |
| | | for d in datas: |
| | | if not is_active_sell(d[7], d[6]): |
| | | continue |
| | | cls.__latest_sell_order_info_list_dict[code].append(d) |
| | | if code not in cls.__latest_sell_order_dict: |
| | | cls.__latest_sell_order_dict[code] = [d[7], d[2], d[1], (d[3], d[6]), (d[3], d[6])] |
| | |
| | | # 大于50w加入卖单 |
| | | money = info[1] * info[2] |
| | | if money >= 500000: |
| | | if is_active_sell(info[0]): |
| | | # 订单里面有成交是主动卖就算主动卖 |
| | | l2_log.info(code, hx_logger_l2_transaction_sell_order, |
| | | f"{cls.__latest_sell_order_dict[code]}") |
| | | cls.__big_sell_order_ids_dict[code].add(info[0]) |
| | |
| | | # 统计最近的大单 |
| | | if latest_sell_order_info[1] * latest_sell_order_info[2] >= 500000: |
| | | if latest_sell_order_info[0] not in temp_sell_order_ids: |
| | | if is_active_sell(latest_sell_order_info[0]): |
| | | # if is_active_sell(latest_sell_order_info[0], latest_sell_order_info[3][1]): |
| | | big_sell_orders.append(latest_sell_order_info) |
| | | temp_sell_order_ids.add(latest_sell_order_info[0]) |
| | | total_sell_info[0] += int(latest_sell_order_info[1] * latest_sell_order_info[2]) |