| | |
| | | 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) |