From cbe19ea6066a600cbd0b5110db5d43f8252d14a8 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 13 六月 2024 11:23:53 +0800 Subject: [PATCH] L撤成交进度相关改进 --- l2/l2_transaction_data_processor.py | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) diff --git a/l2/l2_transaction_data_processor.py b/l2/l2_transaction_data_processor.py index ff3bed5..f02a061 100644 --- a/l2/l2_transaction_data_processor.py +++ b/l2/l2_transaction_data_processor.py @@ -46,7 +46,8 @@ @param datas: @return: """ - buy_datas, bigger_buy_datas = HuaXinBuyOrderManager.statistic_big_buy_data(code, datas) + limit_up_price = round(float(gpcode_manager.get_limit_up_price(code)), 2) + buy_datas, bigger_buy_datas = HuaXinBuyOrderManager.statistic_big_buy_data(code, datas, limit_up_price) if buy_datas: BigOrderDealManager().add_buy_datas(code, buy_datas) try: @@ -80,7 +81,8 @@ limit_up_price = round(float(limit_up_price), 2) # 璁剧疆鎴愪氦浠� try: - current_price_process_manager.set_trade_price(code, datas[-1][1], l2_huaxin_util.convert_time( datas[-1][3]), limit_up_price) + current_price_process_manager.set_trade_price(code, datas[-1][1], l2_huaxin_util.convert_time(datas[-1][3]), + limit_up_price) except: pass total_datas = l2_data_util.local_today_datas.get(code) @@ -110,7 +112,7 @@ if need_cancel: cancel_msg = f"S鎾�:{cancel_msg}" if not need_cancel: - need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code, big_sell_order_info, + need_cancel, cancel_msg = FCancelBigNumComputer().need_cancel_for_p(code, order_begin_pos) # 鍒ゆ柇鏃堕棿鏄惁涓庢湰鍦版椂闂寸浉宸�5s浠ヤ笂 if tool.trade_time_sub(tool.get_now_time_str(), l2_huaxin_util.convert_time(datas[-1][3])) > 10: @@ -122,10 +124,11 @@ # GCancelBigNumComputer().set_big_sell_order_info(code, big_sell_order_info) use_time_list.append(("澶勭悊鍗栧崟鐩稿叧鎾ゆ暟鎹�", time.time() - _start_time)) _start_time = time.time() + HuaXinSellOrderStatisticManager.statistic_total_deal_volume(code, datas) + use_time_list.append(("缁熻鎴愪氦閲忔暟鎹�", time.time() - _start_time)) except Exception as e: async_log_util.error(logger_debug, f"鍗栧崟缁熻寮傚父锛歿big_sell_order_info}") logger_debug.exception(e) - _start_time = time.time() cls.__statistic_thread_pool.submit(cls.statistic_big_order_infos, code, datas, order_begin_pos) @@ -150,13 +153,13 @@ cancel_result = FCancelBigNumComputer().need_cancel_for_deal_fast(code, buy_progress_index) if cancel_result[0]: L2TradeDataProcessor.cancel_buy(code, f"F鎾�:{cancel_result[1]}") - # if not cancel_result[0]: - # try: - # cancel_result = NBCancelBigNumComputer().need_cancel(code, buy_progress_index) - # if cancel_result[0]: - # L2TradeDataProcessor.cancel_buy(code, f"澶у競鍊兼棤澶у崟鎾�:{cancel_result[1]}") - # except: - # pass + if not cancel_result[0]: + try: + cancel_result = NBCancelBigNumComputer().need_cancel(code, buy_progress_index) + if cancel_result[0]: + L2TradeDataProcessor.cancel_buy(code, f"澶у競鍊兼棤澶у崟鎾�:{cancel_result[1]}") + except: + pass if not cancel_result[0] and buy_progress_index_changed: try: @@ -165,10 +168,6 @@ L2TradeDataProcessor.cancel_buy(code, f"W鎾�:{cancel_result[1]}") except: pass - - - - SCancelBigNumComputer().set_transaction_index(code, order_begin_pos.buy_single_index, buy_progress_index) -- Gitblit v1.8.0