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