Files
etf/config/strategies/rotation.yaml
aszerW c1fbd2c7db feat(strategy): finalize global rotation system with advanced risk controls
Summary of updates:
1. Core Logic (engine.py): Added 'score > 0' filtering to support automatic cash positions during market downturns.
2. Experimental Analysis: Added scripts/analyze_negative_scores.py, scripts/test_select_num.py, and scripts/ab_test_iterations.py.
3. Documentation: Created docs/strategy_evolution_report.md detailing the evolution from benchmark to the final 47% CAGR version.
4. Configuration: Finalized rotation.yaml with 11 core assets and optimal risk parameters.
2026-04-30 00:56:20 +08:00

129 lines
3.6 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轮动策略配置
# ==================== 候选池配置 ====================
# 指数-ETF映射配置
# index: 指数代码(用于计算因子信号)
# etf: ETF代码用于实际交易和收益计算null表示直接交易指数/加密货币
code_list:
# 中国A股指数
"399006.SZ":
name: "创业板指"
etf: "159915.SZ"
market: "A"
"H30269.CSI":
name: "中证红利低波"
etf: "512890.SH"
market: "A"
"000015.SH":
name: "上证红利"
etf: "510880.SH"
market: "A"
# 全球市场
"NDX":
name: "纳指100"
etf: "513100.SH"
market: "US"
"N225":
name: "日经225"
etf: "513520.SH"
market: "JP"
"GDAXI":
name: "德国DAX"
etf: "513030.SH"
market: "EU"
"HSI":
name: "恒生指数"
etf: "159920.SZ"
market: "HK"
"HSTECH.HK":
name: "恒生科技"
etf: "513130.SH"
market: "HK"
# 商品 & 固收
"AU.SHF":
name: "黄金"
etf: "518880.SH"
market: "COMMODITY"
"CL.NYM":
name: "原油"
etf: "160723.SZ"
market: "COMMODITY"
"931862.CSI":
name: "30年国债"
etf: "511090.SH"
market: "BOND"
# 主市场配置
primary_market:
source: "Tushare"
code: "000300.SH"
# 基准指数配置
benchmark:
code: "000300.SH"
name: "沪深300"
# ==================== 回测参数 ====================
start_date: "2019-01-01"
# ==================== 因子参数 ====================
# 动量/趋势窗口期(天数)
n_days: 25
# 因子类型:'momentum', 'slope_r2', 'weighted_momentum'
factor_type: "weighted_momentum"
# 动态周期参数 (匹配 JoinQuant 策略)
auto_day: false
min_days: 20
max_days: 60
# ==================== 轮动参数 ====================
select_num: 3
# 强制分散化:每个大类只选 Top 1
diversified: true
# ==================== 调仓控制 ====================
# 最低调仓周期(交易日):持仓至少持有 N 天后才允许换仓
rebalance_days: 1
# 调仓得分阈值:新组合总得分需超过当前组合 X% 才触发调仓
rebalance_threshold: 0.0
# 单次换仓成本(双边,含佣金+滑点)
trade_cost: 0.001
# ==================== 溢价控制配置 ====================
# 跨境ETF溢价过滤机制防止高溢价买入
premium_control:
enabled: true
default_threshold: 0.10 # 默认溢价阈值 10%
mode: "filter" # "filter"(完全排除) 或 "penalize"(降权)
penalty_factor: 0.5 # 降权模式下的惩罚系数
# 按市场类型覆盖配置
market_overrides:
A: # A股 ETF
enabled: false # 不启用(溢价通常 < 0.5%
HK: # 港股 ETF
enabled: true
threshold: 0.10 # 阈值 10%
US: # 美股 ETF
enabled: true
threshold: 0.10 # 阈值 10%
COMMODITY: # 商品 ETF
enabled: false
# ==================== 数据缓存 ====================
# 是否使用本地缓存True=优先从本地读取)
use_cache: true
# ==================== 数据源配置 ====================
# SSH 隧道配置(用于网络受限环境,通过境外服务器访问 yfinance
ssh_tunnel:
enabled: true # 是否启用 SSH 隧道
host: "8.218.167.69" # SSH 服务器地址(阿里云香港 ECS IP
port: 22 # SSH 端口
username: "root" # SSH 用户名
key_path: "hk_ecs.pem" # SSH 私钥路径(相对于项目根目录)
local_port: 1080 # 本地 SOCKS5 代理端口