| | |
| | | from l2.l2_data_util import L2DataUtil, local_today_canceled_buyno_map |
| | | from l2.l2_transaction_data_manager import HuaXinBuyOrderManager |
| | | from l2.transaction_progress import TradeBuyQueue |
| | | from utils import tool |
| | | |
| | | |
| | | def __get_trade_queue(code, start_index, end_index, real_place_order_index, max_count, step=1): |
| | | fresults = [] |
| | | # 正在成交的数据 |
| | | dealing_info = HuaXinBuyOrderManager.get_dealing_order_info(code) |
| | | dealing_active_info = HuaXinBuyOrderManager.get_dealing_active_order_info(code) |
| | | |
| | | total_datas = l2_data_util.local_today_datas.get(code) |
| | | for i in range(start_index, end_index, step): |
| | | # 真实下单位置不管是否撤单都需要加入队列 |
| | |
| | | dealing_info[0]): |
| | | # 减去当前正在成交的数据中已经成交了的数据 |
| | | num -= dealing_info[1] // 100 |
| | | # 判断当前单的主动买的数量 |
| | | if dealing_active_info and str(total_datas[i]["val"]["orderNo"]) == str( |
| | | dealing_active_info[0]): |
| | | if tool.is_sh_code(code): |
| | | # 上证的票需要加上主动买的数据 |
| | | num += dealing_active_info[1] // 100 |
| | | |
| | | if i == real_place_order_index: |
| | | type_ = 1 |
| | | has_real_order_index = True |