Files
etf/config/strategies/rotation.yaml
aszerW 062f500369 refactor(rotation): 统一与配置文件代码映射和基准指数使用方式
- 将默认代码映射字典和基准指数改为可被策略配置覆盖的形式
- 修改配置文件rotation.yaml中候选池配置从列表变为代码与名称的字典映射
- 在运行脚本中加载配置时支持字典格式的code_list和benchmark,兼容旧格式列表
- 更新回测策略引擎通过配置动态获取基准指数代码
- 打印输出和函数调用中统一使用从配置加载的代码映射和基准名称数据
2026-03-19 00:33:06 +08:00

63 lines
1.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ETF轮动策略配置
# ==================== 候选池配置 ====================
# A股全行业指数配置Tushare格式XXXXXX.SH / XXXXXX.SZ
# 格式: {代码: 名称}
code_list:
# 宽基指数
"000300.SH": "沪深300"
"000905.SH": "中证500"
"000852.SH": "中证1000"
"399006.SZ": "创业板指"
"000015.SH": "上证红利"
# 金融
"399986.SZ": "中证银行"
# 消费
"399997.SZ": "中证白酒"
# 医药健康
"399989.SZ": "中证医疗"
# 科技信息
"000935.SH": "中证信息"
# 新能源
"399976.SZ": "新能源车"
# 周期资源
"399395.SZ": "国证有色"
"399998.SZ": "中证煤炭"
"399813.SZ": "细分化工"
"000937.SH": "中证能源"
# 其他行业
"399967.SZ": "中证军工"
"000949.SH": "中证农业"
"399702.SZ": "国债指数"
# 基准指数配置
benchmark:
code: "000300.SH"
name: "沪深300指数"
# ==================== 回测参数 ====================
start_date: "2018-01-01"
# end_date: "2025-03-17"
# ==================== 因子参数 ====================
# 动量/趋势窗口期(天数)
n_days: 25
# 因子类型:'momentum'N日涨幅或 'slope_r2'斜率×
factor_type: "slope_r2"
# ==================== 轮动参数 ====================
# 每次轮动选中的ETF数量1=全仓单一品种)
select_num: 5
# ==================== 调仓控制 ====================
# 最低调仓周期(交易日):持仓至少持有 N 天后才允许换仓
rebalance_days: 1
# 调仓得分阈值:新组合总得分需超过当前组合 X% 才触发调仓
rebalance_threshold: 0.0
# 单次换仓成本(双边,含佣金+滑点)
trade_cost: 0.001
# ==================== 数据缓存 ====================
# 是否使用本地缓存True=优先从本地读取)
use_cache: true