| | |
| | | if real_place_order_info and real_place_order_info[0] > index: |
| | | total_datas = local_today_datas.get(code) |
| | | min_num = int(5000 / (float(gpcode_manager.get_limit_up_price(code)))) |
| | | for j in range(index + 1, real_place_order_info[0]): |
| | | for j in range(real_place_order_info[0]-1, index , -1): |
| | | data = total_datas[j] |
| | | val = data['val'] |
| | | if data["index"] in watch_indexes: |
| | |
| | | code)) |
| | | if left_count > 0: |
| | | watch_indexes.add(data["index"]) |
| | | l2_log.l_cancel_debug(code, f"L后有成交重新囊括:成交索引-{index} 囊括索引-{data['index']}") |
| | | break |
| | | self.__set_watch_indexes(code, watch_indexes_info[0], watch_indexes_info[1], watch_indexes) |
| | | |
| | |
| | | 统计大单买 |
| | | @param code: |
| | | @param datas: |
| | | @return: 返回数据里面成交的大单 |
| | | @return: 返回数据里面(成交的大单,50w以上的单) |
| | | """ |
| | | big_buy_datas = [] |
| | | normal_buy_datas = [] |
| | | for data in datas: |
| | | # q.append((data['SecurityID'], data['TradePrice'], data['TradeVolume'], |
| | | # data['OrderTime'], data['MainSeq'], data['SubSeq'], data['BuyNo'], |
| | |
| | | # 是否为大买单 |
| | | if deal_info[2] >= 2990000: |
| | | big_buy_datas.append(deal_info) |
| | | if deal_info[2] >= 500000: |
| | | normal_buy_datas.append(deal_info) |
| | | |
| | | # 初始化本条数据 |
| | | cls.__dealing_order_info_dict[code] = [data[6], data[2], data[2] * data[1], data[3], data[3]] |
| | | return big_buy_datas |
| | | return big_buy_datas, normal_buy_datas |
| | | |
| | | |
| | | # 卖单统计数据 |
| | |
| | | from l2 import l2_data_util, l2_data_manager, transaction_progress |
| | | from l2.cancel_buy_strategy import FCancelBigNumComputer, LCancelBigNumComputer, LCancelRateManager, \ |
| | | GCancelBigNumComputer, SCancelBigNumComputer, HourCancelBigNumComputer, NewGCancelBigNumComputer |
| | | from l2.l2_data_manager import OrderBeginPosInfo |
| | | from l2.l2_data_manager_new import L2TradeDataProcessor |
| | | from l2.l2_data_util import L2DataUtil |
| | | from l2.l2_transaction_data_manager import HuaXinBuyOrderManager, HuaXinSellOrderStatisticManager, BigOrderDealManager |
| | |
| | | return buy_progress_index |
| | | |
| | | @classmethod |
| | | def statistic_big_order_infos(cls, code, datas): |
| | | def statistic_big_order_infos(cls, code, datas, order_begin_pos:OrderBeginPosInfo): |
| | | """ |
| | | 统计大单成交 |
| | | @param code: |
| | | @param datas: |
| | | @return: |
| | | """ |
| | | buy_datas = HuaXinBuyOrderManager.statistic_big_buy_data(code, datas) |
| | | buy_datas, bigger_buy_datas = HuaXinBuyOrderManager.statistic_big_buy_data(code, datas) |
| | | if buy_datas: |
| | | BigOrderDealManager().add_buy_datas(code, buy_datas) |
| | | try: |
| | | is_placed_order = l2_data_manager.TradePointManager.is_placed_order(order_begin_pos) |
| | | if is_placed_order and bigger_buy_datas: |
| | | # 有大于50w的大单成交 |
| | | buyno_map = l2_data_util.local_today_buyno_map.get(code) |
| | | if buyno_map: |
| | | for buy_data in bigger_buy_datas: |
| | | order_no = f"{buy_data[0]}" |
| | | if order_no in buyno_map: |
| | | LCancelBigNumComputer().add_deal_index(code, buyno_map[order_no]["index"], order_begin_pos.buy_single_index) |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | |
| | | sell_datas = HuaXinSellOrderStatisticManager.statistic_big_sell_data(code, datas) |
| | | if sell_datas: |
| | |
| | | # # L后是否有成交,如果有成交就需要除去当前笔数,然后重新囊括一笔 |
| | | # # 暂时不需要这种复杂的机制 |
| | | # # LCancelBigNumComputer().add_deal_index(code, data["index"], order_begin_pos.buy_single_index) |
| | | cls.__statistic_thread_pool.submit(cls.statistic_big_order_infos, code, datas) |
| | | cls.__statistic_thread_pool.submit(cls.statistic_big_order_infos, code, datas, order_begin_pos) |
| | | |
| | | use_time_list.append(("统计买单数据", time.time() - _start_time)) |
| | | _start_time = time.time() |
| | |
| | | buy_progress_index) |
| | | if is_placed_order: |
| | | NewGCancelBigNumComputer().set_trade_progress(code, order_begin_pos.buy_single_index, |
| | | buy_progress_index) |
| | | buy_progress_index) |
| | | LCancelBigNumComputer().set_trade_progress(code, order_begin_pos.buy_single_index, |
| | | buy_progress_index, |
| | | total_datas) |