feat: S6叙事一致性检查+统一入口+容量60硬顶+提拔先入观察
- candidate_filter S6: 消息(个股+行业)x资金x技术叙事矩阵 利好出货/三重打击=硬否决(dropped=1,不可被高分抵消) 共振做多+3/利空出尽+1/资金驱动+1/阴跌-1/行业利空-1 - promote: 信号一律先入'关注'(12维确认才升,消灭出生即买入); 容量60硬顶,RR<2的末位淘汰 - alphasift收编: 只写candidates不再直写自选(统一入口)
This commit is contained in:
@@ -209,29 +209,29 @@ def run_all(strategies_str, market, max_results, dry_run=False):
|
||||
print("\n[DRY RUN] 未写入")
|
||||
return
|
||||
|
||||
# 写入 DB
|
||||
# 写入 DB(2026-07-24 老爸"统一入口":只写 candidates,不许直写自选。
|
||||
# 后续由 promote_candidates 的 score>=7+RR>=2+S6叙事闸 统一提拔)
|
||||
try:
|
||||
sys.path.insert(0, str(MOFIN_DATA.parent))
|
||||
from mofin_db import get_conn, write_watchlist_stock
|
||||
from mofin_db import get_conn
|
||||
conn = get_conn()
|
||||
for s in new_stocks:
|
||||
s.setdefault('currency', 'CNY')
|
||||
write_watchlist_stock(conn, s)
|
||||
sd = s.get("source_detail", {})
|
||||
conn.execute(
|
||||
"INSERT INTO candidates (code, name, sector, reason, entry_range, stop_loss, target, created_at) "
|
||||
"VALUES (?,?,?,?,?,?,?,datetime('now','localtime')) "
|
||||
"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",
|
||||
(s["code"], s["name"], "alpha_sift",
|
||||
f"{s.get('notes','')}",
|
||||
"", 0, 0))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
print(f"\n已写入 {len(new_stocks)} 只到 DB watchlist_stocks")
|
||||
print(f"\n已写入 {len(new_stocks)} 只到 candidates(等待 candidate_filter 多级过滤+promote 统一提拔)")
|
||||
except Exception as e:
|
||||
print(f"WARN: DB写入失败: {e}")
|
||||
return
|
||||
|
||||
# 策略生成
|
||||
print("\n调用 regenerate_all()...")
|
||||
try:
|
||||
sys.path.insert(0, str(MOFIN_DATA.parent))
|
||||
from strategy_lifecycle import regenerate_all
|
||||
r = regenerate_all(stdout=True)
|
||||
if r: print(f"完成: {r.get('ok',0)}/{r.get('total',0)} 只策略已生成")
|
||||
except Exception as e:
|
||||
print(f"WARN: {e}")
|
||||
|
||||
|
||||
def list_strategies():
|
||||
|
||||
Reference in New Issue
Block a user