fix: promote加source_strategy→sector fallback——unknown时用sector,不再推送unknown策略
This commit is contained in:
@@ -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 fallback:source_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,)
|
||||
|
||||
Reference in New Issue
Block a user