| | |
| | | special_code_volume_for_order_dict = {} |
| | | # 已经订阅的代码 |
| | | subscripted_codes = set() |
| | | # 代码的上次成交的订单唯一索引 |
| | | __last_transaction_keys_dict = {} |
| | | |
| | | def __init__(self, api): |
| | | lev2mdapi.CTORATstpLev2MdSpi.__init__(self) |
| | |
| | | "SubSeq": pTransaction['SubSeq'], "BuyNo": pTransaction['BuyNo'], |
| | | "SellNo": pTransaction['SellNo'], |
| | | "ExecType": pTransaction['ExecType'].decode()} |
| | | key = f"{item['SecurityID']}_{item['TradePrice']}_{item['BuyNo']}" |
| | | if self.__last_transaction_keys_dict.get(code) == key: |
| | | return |
| | | self.__last_transaction_keys_dict[code] = key |
| | | # print("逐笔成交", item) |
| | | l2_data_manager.add_transaction_detail(item) |
| | | |
| | |
| | | print("l2_client启动成功") |
| | | while True: |
| | | time.sleep(2) |
| | | |
| | | |
| | | |
| | | if __name__ == "__main__": |