refactor: 配置文件迁移到策略目录(模块自包含)

迁移内容:
- config/strategies/rotation.yaml → strategies/rotation/config.yaml

路径更新(核心文件):
- strategies/rotation/strategy.py(注释示例)
- scripts/generate_legacy_report.py(config_path)
- run_rotation.py(注释和默认参数)
- datasource/hybrid_source.py(from_yaml示例和fetch_rotation_data)

保留:
- config/strategies/cci.yaml(无对应策略目录,暂保留)

设计原则:策略模块自包含,配置与实现同目录,方便移植和复制

验证:策略加载成功(候选池11只,回测区间2019-01-01 ~ 2026-05-12)
This commit is contained in:
2026-05-12 22:14:35 +08:00
parent 0a8d0d9212
commit aeb95a6f4c
5 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ class HybridDataSource:
使用方式:
from datasource import HybridDataSource
source = HybridDataSource.from_yaml('config/strategies/rotation.yaml')
source = HybridDataSource.from_yaml('strategies/rotation/config.yaml')
result = source.fetch_all()
"""
@@ -259,7 +259,7 @@ class HybridDataSource:
# 简化接口
def fetch_rotation_data(config_path: str = "config/strategies/rotation.yaml") -> dict:
def fetch_rotation_data(config_path: str = "strategies/rotation/config.yaml") -> dict:
"""
获取轮动策略数据(简化接口)