| | |
| | | |
| | | # 获取撤单比例,返回(撤单比例,是否必买) |
| | | @classmethod |
| | | def get_cancel_rate(cls, code, buy_exec_time, is_up=False, is_l_down_recomputed=False): |
| | | def get_cancel_rate(cls, code, buy_exec_time, is_up=False, is_l_down_recomputed=False, buy_mode = None): |
| | | try: |
| | | must_buy = cls.__MustBuyCodesManager.is_in_cache(code) |
| | | if must_buy: |
| | | if is_up: |
| | | return constant.L_CANCEL_RATE_UP_WITH_MUST_BUY, True |
| | | if buy_mode == OrderBeginPosInfo.MODE_RADICAL: |
| | | # 扫入的化撤单比例调整为80% |
| | | return constant.L_CANCEL_RATE_WITH_MUST_BUY_FOR_REDICAL_BUY, True |
| | | else: |
| | | return constant.L_CANCEL_RATE_WITH_MUST_BUY, True |
| | | if is_up: |
| | | return constant.L_CANCEL_RATE_UP_WITH_MUST_BUY, True |
| | | else: |
| | | return constant.L_CANCEL_RATE_WITH_MUST_BUY, True |
| | | except Exception as e: |
| | | async_log_util.error(logger_l2_l_cancel, str(e)) |
| | | |