From 86192a7fd4bd7bde5745e82495c717967b8493a2 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 18 七月 2023 17:22:22 +0800 Subject: [PATCH] L撤/D撤接入 --- l2/l2_data_manager_new.py | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index edfde48..b0c3625 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -15,7 +15,7 @@ from l2 import safe_count_manager, l2_data_manager, l2_data_log, l2_log, l2_data_source_util, code_price_manager, \ transaction_progress from l2.cancel_buy_strategy import SecondCancelBigNumComputer, HourCancelBigNumComputer, L2LimitUpMoneyStatisticUtil, \ - L2LimitUpSellStatisticUtil, DCancelBigNumComputer + L2LimitUpSellStatisticUtil, DCancelBigNumComputer, LCancelBigNumComputer from l2.l2_data_manager import L2DataException, TradePointManager from l2.l2_data_util import local_today_datas, L2DataUtil, local_today_num_operate_map, local_today_buyno_map, \ local_latest_datas @@ -417,6 +417,24 @@ l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-H鎾ゅぇ鍗曡绠�") return None, "" + # L鎾� + @dask.delayed + def l_cancel(): + _start_time = round(t.time() * 1000) + try: + b_need_cancel, b_cancel_data = LCancelBigNumComputer.need_cancel(code, + buy_exec_index, start_index, + end_index, total_data, + local_today_num_operate_map.get( + code), is_first_code) + if b_need_cancel and b_cancel_data: + return b_cancel_data, "L鎾ら攢姣斾緥瑙﹀彂闃堝��" + except Exception as e: + logging.exception(e) + finally: + l2_data_log.l2_time(code, round(t.time() * 1000) - _start_time, "宸蹭笅鍗�-L鎾ゅぇ鍗曡绠�") + return None, "" + # 鏉夸笂鍗栨挙 @dask.delayed def sell_cancel(): @@ -464,9 +482,10 @@ f4 = h_cancel() f5 = buy_1_cancel() f6 = sell_cancel() - dask_result = is_need_cancel(f1, f2, f3, f4, f5, f6) + f7 = l_cancel() + dask_result = is_need_cancel(f1, f2, f3, f4, f5, f6, f7) if is_first_code: - dask_result = is_need_cancel(f3, f4) + dask_result = is_need_cancel(f3, f4, f7) cancel_data, cancel_msg = dask_result.compute() -- Gitblit v1.8.0