diff --git a/deploy/profile-scripts/b_td1_v3_scanner.py b/deploy/profile-scripts/b_td1_v3_scanner.py index 3195a043..137a5cb0 100644 --- a/deploy/profile-scripts/b_td1_v3_scanner.py +++ b/deploy/profile-scripts/b_td1_v3_scanner.py @@ -152,13 +152,15 @@ def main(): all_stocks, existing = get_stock_pool() print(f" 股票池 {len(all_stocks)} 只", flush=True) hits = [] - for code, name in all_stocks: + for code in all_stocks: + if code in existing: + continue try: klines = fetch_tx_klines(code, datalen=120) sig = check_b_td1(klines, code) if sig: - hits.append((code, name, sig)) - except Exception as e: + hits.append((code, code, sig)) # name 暂用 code(与 mr_scanner 同源) + except Exception: pass # score 降序 top-N hits.sort(key=lambda x: -x[2]["score"]) @@ -176,7 +178,7 @@ def main(): "ON CONFLICT(code) DO UPDATE SET " "name=excluded.name, sector=excluded.sector, reason=excluded.reason, " "entry_range=excluded.entry_range, stop_loss=excluded.stop_loss, target=excluded.target", - (code, name, "b_td1_v3", reasons, + (code, code, "b_td1_v3", reasons, f"{sig['price']*0.98:.2f}~{sig['price']:.2f}", sig["stop_loss"], sig["target"])) inserted += 1 print(f" 🟢 {code} {name} 价{sig['price']} score={sig['score']} {reasons}", flush=True) diff --git a/deploy/profile-scripts/s2_panic_v2_scanner.py b/deploy/profile-scripts/s2_panic_v2_scanner.py index 3a47cf1a..e9fd4b68 100644 --- a/deploy/profile-scripts/s2_panic_v2_scanner.py +++ b/deploy/profile-scripts/s2_panic_v2_scanner.py @@ -134,12 +134,14 @@ def main(): all_stocks, existing = get_stock_pool() print(f" 股票池 {len(all_stocks)} 只", flush=True) hits = [] - for code, name in all_stocks: + for code in all_stocks: + if code in existing: + continue try: klines = fetch_tx_klines(code, datalen=120) sig = check_s2v2(klines, code) if sig: - hits.append((code, name, sig)) + hits.append((code, code, sig)) # name 暂用 code except Exception: pass hits.sort(key=lambda x: -x[2]["score"]) @@ -155,7 +157,7 @@ def main(): "ON CONFLICT(code) DO UPDATE SET " "name=excluded.name, sector=excluded.sector, reason=excluded.reason, " "entry_range=excluded.entry_range, stop_loss=excluded.stop_loss, target=excluded.target", - (code, name, "s2_panic_v2", reasons, + (code, code, "s2_panic_v2", reasons, f"{sig['price']*0.98:.2f}~{sig['price']:.2f}", sig["stop_loss"], sig["target"])) inserted += 1 print(f" 🟢 {code} {name} 价{sig['price']} score={sig['score']} {reasons}", flush=True)