refactor: market_watch 移除mr_scanner/s2_scanner嵌入调用——策略扫描器独立调度(单一职责),market_watch只做板块采集+regime

This commit is contained in:
hmo
2026-08-11 07:15:06 +08:00
parent 5ee934593b
commit d768b57523
-42
View File
@@ -263,48 +263,6 @@ def main():
except Exception as _e: except Exception as _e:
print(f"[regime] 计算失败: {_e}", flush=True) print(f"[regime] 计算失败: {_e}", flush=True)
# ── v_mr 均值回复扫描(每天最多一次,regime 门控内置)──
# trend_down/choppy 时扫描深超跌小盘票,写 candidates(sector='v_mr')
# mr_scanner 自带幂等保护:当天已有 v_mr 候选则跳过,避免重复全扫描
try:
import subprocess as _sp
import sys as _sys
_script = Path(__file__).parent / "mr_scanner.py"
if _script.exists():
_r = _sp.run(
[_sys.executable, str(_script), "--top", "15"],
capture_output=True, text=True, timeout=1500)
if _r.stdout:
for _line in _r.stdout.strip().splitlines():
print(f"[mr_scanner] {_line}", flush=True)
if _r.returncode != 0 and _r.stderr:
print(f"[mr_scanner] stderr: {_r.stderr[:500]}", flush=True)
else:
print("[mr_scanner] 脚本不存在,跳过", flush=True)
except Exception as _e:
print(f"[mr_scanner] 调用失败: {_e}", flush=True)
# ── S2 恐慌买超跌扫描(每天最多一次,大盘RSI<25门控内置)──
# 策略家族(§39): S1(v_weak甜区)+S2(恐慌买)同时运行零重叠
# s2_scanner 自带幂等:当天已有 s2_panic 候选则跳过
try:
import subprocess as _sp2
import sys as _sys2
_script2 = Path(__file__).parent / "s2_scanner.py"
if _script2.exists():
_r2 = _sp2.run(
[_sys2.executable, str(_script2), "--top", "15"],
capture_output=True, text=True, timeout=1500)
if _r2.stdout:
for _line in _r2.stdout.strip().splitlines():
print(f"[s2_scanner] {_line}", flush=True)
if _r2.returncode != 0 and _r2.stderr:
print(f"[s2_scanner] stderr: {_r2.stderr[:500]}", flush=True)
else:
print("[s2_scanner] 脚本不存在,跳过", flush=True)
except Exception as _e2:
print(f"[s2_scanner] 调用失败: {_e2}", flush=True)
# 靜默:只寫文件,不輸出到stdout,避免cron推送 # 靜默:只寫文件,不輸出到stdout,避免cron推送