fix: promote加source_strategy→sector fallback——unknown时用sector,不再推送unknown策略

This commit is contained in:
xxm
2026-08-18 10:18:44 +08:00
parent c8b08bade5
commit 416f9f1874
@@ -61,6 +61,10 @@ def main():
# 2026-08-11:读取候选 sector(用于 p_oversold RR 例外)
cand_sector = str(r[6] or "").strip() if len(r) > 6 else ""
source_strategy = str(r[8] or "").strip() if len(r) > 8 else ""
# 2026-08-18 fallbacksource_strategy 为 unknown/空时用 candidates.sector 作来源
# (自选退出回归候选 sector 是正确策略标签,但 source_strategy 可能 inherited unknown
if not source_strategy or source_strategy == "unknown":
source_strategy = cand_sector if cand_sector and cand_sector != "unknown" else "unknown" ""
exists = conn.execute(
"SELECT id FROM holding_strategies WHERE code=? AND status='active'",
(code,)