| | |
| | | from trade import trade_queue_manager, l2_trade_factor |
| | | from l2 import l2_log, l2_data_source_util |
| | | from l2.l2_data_util import L2DataUtil, local_today_num_operate_map, local_today_datas |
| | | from log_module.log import logger_buy_1_volumn, logger_l2_d_cancel |
| | | from log_module.log import logger_buy_1_volumn, logger_l2_d_cancel, logger_l2_l_cancel |
| | | from utils.tool import CodeDataCacheUtil |
| | | |
| | | |
| | |
| | | for min_money in MIN_MONEYS: |
| | | watch_indexes = set() |
| | | for i in range(end_index, start_index, -1): |
| | | data = total_datas[i] |
| | | val = data['val'] |
| | | if not L2DataUtil.is_limit_up_price_buy(val): |
| | | continue |
| | | # 小金额过滤 |
| | | if float(val['price']) * val['num'] < min_money * 100: |
| | | continue |
| | | left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count(code, i, |
| | | total_datas, |
| | | local_today_num_operate_map.get( |
| | | code)) |
| | | if left_count > 0: |
| | | watch_indexes.add(i) |
| | | if len(watch_indexes) >= 5: |
| | | break |
| | | # if i > len(total_datas): |
| | | # continue |
| | | try: |
| | | data = total_datas[i] |
| | | val = data['val'] |
| | | if not L2DataUtil.is_limit_up_price_buy(val): |
| | | continue |
| | | # 小金额过滤 |
| | | if float(val['price']) * val['num'] < min_money * 100: |
| | | continue |
| | | left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count(code, i, |
| | | total_datas, |
| | | local_today_num_operate_map.get( |
| | | code)) |
| | | if left_count > 0: |
| | | watch_indexes.add(i) |
| | | if len(watch_indexes) >= 5: |
| | | break |
| | | except Exception as e: |
| | | logger_l2_l_cancel.error(f"{code}: {start_index}-{end_index}") |
| | | logger_l2_l_cancel.exception(e) |
| | | if watch_indexes: |
| | | self.__set_watch_indexes(code, watch_indexes) |
| | | l2_log.l_cancel_debug(code, f"设置监听范围, 数据范围:{start_index}-{end_index} 监听范围-{watch_indexes}") |