diff --git a/scripts/stale_push_wlin.py b/scripts/stale_push_wlin.py index da66822e..58882e3d 100644 --- a/scripts/stale_push_wlin.py +++ b/scripts/stale_push_wlin.py @@ -437,6 +437,16 @@ def main(): pass # 重新过滤:重评后可能有策略变化(止盈/止损/信号变动) + # 去重:同一股票只推送一次(防止两个源重复) + seen_codes = set() + deduped = [] + for item in all_candidates: + code = item[1] + if code not in seen_codes: + seen_codes.add(code) + deduped.append(item) + all_candidates = deduped + # 重建 stocks 列表,用新数据判断(不再用旧 is_stale 标记,因为已全部重评) stocks = [] for (name, code, price, buy_low, buy_high, cur, is_stale) in all_candidates: