From f08cb61eb22a7c006c84fe57a2e857e2b23b061c Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 27 六月 2024 14:35:48 +0800 Subject: [PATCH] 相同价格判断机制bug修复 --- l2/l2_transaction_data_processor.py | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/l2/l2_transaction_data_processor.py b/l2/l2_transaction_data_processor.py index a18b3c2..dc71ec9 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,12 +112,13 @@ 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: - need_cancel, cancel_msg = True, f"鎴愪氦鏃堕棿涓庢湰鍦版椂闂寸浉宸�10S浠ヤ笂锛寋l2_huaxin_util.convert_time(datas[-1][3])}" - + now_seconds = int(tool.get_now_time_str().replace(":", "")) + if now_seconds < int("093200"): #or int("130000") <= now_seconds < int("130200"): + need_cancel, cancel_msg = True, f"鎴愪氦鏃堕棿涓庢湰鍦版椂闂寸浉宸�10S浠ヤ笂锛寋l2_huaxin_util.convert_time(datas[-1][3])}" if need_cancel: L2TradeDataProcessor.cancel_buy(code, cancel_msg) @@ -166,10 +169,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