feat: 策略自我进化闭环落地——evolution_engine新建(退化检测+数据驱动变体±20%+2y回测验证+达标才推送)+lesson_extractor重写(实盘平仓+温区归因)+auto_iterator归档+cron每周六22:00

This commit is contained in:
xxm
2026-08-15 18:26:24 +08:00
parent 8db28a3479
commit 4f6c8cad4d
5 changed files with 558 additions and 92 deletions
+29
View File
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
"""evolution_daily.py — 策略进化引擎 cron 入口(每周六 22:00hermes cron
放在 deploy/profile-scripts(硬链接进 cron scripts 目录),
内部调用 evolution/evolution_engine.py(真正逻辑所在,含单例守卫)。
设计依据:docs/decisions/2026-08-15-策略自我进化闭环重构.md
- 每周六 22:00 运行(策略评估 21:00 之后)
- 无退化/变体不达标 → 静默
- 达标变体 → strategy_evolution + XMPP 推送老莫(永不自动 promote)
"""
import subprocess, sys, os
REPO = "/home/hmo/MoFin"
ENGINE = f"{REPO}/evolution/evolution_engine.py"
PY = f"{REPO}/venv/bin/python"
def main():
if not os.path.exists(ENGINE):
print(f"evolution_engine.py 不存在: {ENGINE}", flush=True)
sys.exit(1)
# 单例守卫在 engine 内部(fcntl),这里直接调用
r = subprocess.run([PY, ENGINE], cwd=REPO, capture_output=False, timeout=3600)
sys.exit(r.returncode)
if __name__ == "__main__":
main()