| | |
| | | # 当前批次正在处理的数据索引 |
| | | __processing_data_indexes = {} |
| | | |
| | | # 是否中断买入 |
| | | __break_buy_dict = {} |
| | | # 下次买的时间 |
| | | __next_buy_time_dict = {} |
| | | |
| | | # 获取代码评分 |
| | | @classmethod |
| | |
| | | # 处理未挂单 |
| | | @classmethod |
| | | def __process_not_order(cls, code, start_index, end_index, capture_time, is_first_code): |
| | | cls.__break_buy_dict[code] = False |
| | | __start_time = round(t.time() * 1000) |
| | | # 获取阈值 |
| | | threshold_money, msg = cls.__get_threshmoney(code) |
| | |
| | | buy1_money = 1 |
| | | deal_rate = round(total_deal_money / buy1_money, 2) |
| | | if deal_rate < 0.05: |
| | | cls.__break_buy_dict[code] = True |
| | | return False, True, f"板上放量成交金额不足,近2s总成交比例({deal_rate}):{total_deal_money}/{buy1_money}小于0.05" |
| | | # 判断成交进度是否距离我们的位置很近 |
| | | trade_index, is_default = cls.__TradeBuyQueue.get_traded_index(code) |
| | |
| | | buy_count = 0 |
| | | min_num = int(5000 / limit_up_price) |
| | | range_indexes = cls.__processing_data_indexes.get(code) |
| | | if range_indexes: |
| | | # 获取成交进度位 |
| | | trade_index, is_default = transaction_progress.TradeBuyQueue().get_traded_index(code) |
| | | if trade_index is None: |
| | | trade_index = 0 |
| | | for i in range(trade_index + 1, range_indexes[1] + 1): |
| | | if range_indexes: |
| | | # 获取成交进度位 |
| | | for i in range(range_indexes[0], range_indexes[1] + 1): |
| | | val = total_datas[i]["val"] |
| | | if not L2DataUtil.is_limit_up_price_buy(val): |
| | | continue |
| | |
| | | break |
| | | if buy_count > THRESHOLD_BUY_COUNT: |
| | | HuaXinSellOrderStatisticManager.clear_latest_deal_volume(code) |
| | | cls.__break_buy_dict[code] = True |
| | | return False, True, f"执行位批次数据量({buy_count})大于{THRESHOLD_BUY_COUNT}" |
| | | cls.__next_buy_time_dict[code] = t.time() + 1 |
| | | return False, True, f"执行位批次数据量({buy_count})大于{THRESHOLD_BUY_COUNT} {range_indexes[0]}-{range_indexes[1]}" |
| | | # 暂时注释想买单功能 |
| | | if not cls.__WantBuyCodesManager.is_in_cache(code): |
| | | # if cls.__TradeTargetCodeModeManager.get_mode_cache() == TradeTargetCodeModeManager.MODE_ONLY_BUY_WANT_CODES: |
| | |
| | | is_first_code, |
| | | new_add=True): |
| | | |
| | | # 已经中断买入 |
| | | if cls.__break_buy_dict.get(code): |
| | | # 判断下次买入时间是否正确 |
| | | if code in cls.__next_buy_time_dict and t.time() < cls.__next_buy_time_dict[code]: |
| | | return |
| | | if code in cls.__next_buy_time_dict: |
| | | cls.__next_buy_time_dict.pop(code) |
| | | |
| | | if compute_end_index < compute_start_index: |
| | | return |