| | |
| | | if transaction_data[2] < 10000: |
| | | return False, "成交量小于10000" |
| | | # 成交100万以上才算 |
| | | if transaction_data[1]*transaction_data[2] < 1000000: |
| | | if transaction_data[1] * transaction_data[2] < 1000000: |
| | | return False, "金额不满足要求" |
| | | code = transaction_data[0] |
| | | real_order_index = self.__real_order_index_cache.get(code) |
| | |
| | | final_watch_indexes = origin_watch_index | watch_indexes |
| | | self.__watch_indexes_dict[code] = final_watch_indexes |
| | | else: |
| | | l2_log.g_cancel_debug(code,f"没有大单监听,开始计算小单:{start_index}-{real_order_index}") |
| | | l2_log.g_cancel_debug(code, f"没有大单监听,开始计算小单:{start_index}-{real_order_index}") |
| | | # 没有300万以上的大单了,计算备用 |
| | | # 只有备用单成交了或者没有备用单,才会再次寻找备用单 |
| | | need_find_by = False |
| | |
| | | watch_indexes_by = self.__watch_indexes_by_dict.get(code) |
| | | if watch_indexes_by is None: |
| | | watch_indexes_by = set() |
| | | |
| | | need_compute = False |
| | | for i in range(start_index, end_index + 1): |
| | | data = total_datas[i] |
| | | val = data["val"] |
| | |
| | | code)) |
| | | if buy_index is not None and buy_index < real_place_order_index and ( |
| | | buy_index in watch_indexes or buy_index in watch_indexes_by): |
| | | return True, data, "" |
| | | if buy_index in watch_indexes_by: |
| | | # 备用撤单,直接撤 |
| | | return True, data, "" |
| | | elif buy_index in watch_indexes: |
| | | # 大单撤需要重新计算大单撤单比例 |
| | | need_compute = True |
| | | break |
| | | if need_compute: |
| | | canceled_indexes = set() |
| | | for index in watch_indexes: |
| | | cancel_data = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_canceled_data_v2(code, index, |
| | | total_datas, |
| | | local_today_canceled_buyno_map.get( |
| | | code)) |
| | | if cancel_data: |
| | | canceled_indexes.add(cancel_data["index"]) |
| | | cancel_rate = len(canceled_indexes) / len(watch_indexes) |
| | | if cancel_rate > 0.2: |
| | | canceled_indexes_list = list(canceled_indexes) |
| | | canceled_indexes_list.sort() |
| | | return True, total_datas[canceled_indexes_list[-1]], f"撤单比例:{cancel_rate}" |
| | | |
| | | return False, None, "" |
| | | |
| | | def place_order_success(self, code): |