| | |
| | | @classmethod |
| | | def get_cancel_rate(cls, code, buy_exec_time, is_up=False): |
| | | # 下单10s内撤单比例为设置为29% |
| | | if tool.trade_time_sub(tool.get_now_time_str(), buy_exec_time) <= 10: |
| | | if not is_up and tool.trade_time_sub(tool.get_now_time_str(), buy_exec_time) <= 15: |
| | | return 0.29, False |
| | | try: |
| | | must_buy_cancel_rate = cls.__MustBuyCodesManager.get_cancel_rate_cache(code) |
| | |
| | | if transaction_data[2] > buy_data["val"]["num"] * 100 * 0.5: |
| | | return True, "快速成交了50%以上" |
| | | else: |
| | | return False, "" |
| | | return False, "快速成交了50%以下" |
| | | |
| | | # 设置真实的下单位置,返回是否需要撤单 |
| | | def set_real_order_index(self, code, index): |
| | |
| | | from l2 import l2_data_util, l2_data_manager, transaction_progress, l2_data_source_util |
| | | from l2.cancel_buy_strategy import LCancelRateManager, LCancelBigNumComputer, \ |
| | | SecondCancelBigNumComputer, HourCancelBigNumComputer, \ |
| | | GCancelBigNumComputer |
| | | GCancelBigNumComputer, FCancelBigNumComputer |
| | | from l2.l2_data_manager_new import L2TradeDataProcessor |
| | | from l2.l2_data_util import L2DataUtil, local_today_canceled_buyno_map |
| | | from log_module import async_log_util |
| | |
| | | |
| | | order_begin_pos = l2_data_manager.TradePointManager().get_buy_compute_start_data_cache(code) |
| | | |
| | | if order_begin_pos and order_begin_pos.buy_exec_index and order_begin_pos.buy_exec_index > -1: |
| | | # 已经下单的需要统计F撤 |
| | | try: |
| | | for d in datas: |
| | | if FCancelBigNumComputer().need_cancel(d)[0]: |
| | | L2TradeDataProcessor.cancel_buy(code, "F撤撤单") |
| | | order_begin_pos = None |
| | | break |
| | | except Exception as e: |
| | | async_log_util.error(hx_logger_l2_debug, str(e)) |
| | | # 计算已经成交的大单 |
| | | big_money_count = 0 |
| | | for d in datas: |