feat: V3动态阈值实施方案落地

核心逻辑:
1. config.yaml新增bond_threshold配置块
2. selectors.py新增动态阈值逻辑:
   - _get_dynamic_threshold(): 阈值=短债动量×ratio
   - _grouped_selection(): BOND不参与竞争,空余仓位填充短债
3. strategy.py传入bond_threshold_config

回测验证:
- 最终净值: 292.56
- 累计收益: 29155.96%
- 持仓3只: 92.3%(满仓率提升)
- 短债填充: 27.7%时间启用(空余仓位)

信号特征:
- 短债可重复出现表示仓位占比
- 例如 "NDX,931862.CSI,931862.CSI" → NDX 33%, 短债 67%
This commit is contained in:
2026-05-18 23:58:10 +08:00
parent 3e6d9d1fdb
commit 74a664d4ff
3 changed files with 69 additions and 24 deletions

View File

@@ -125,6 +125,14 @@ diversified: true
# 设置为0表示过滤负动量标的更高阈值虽能改善回撤但可能错过正动量机会
min_score: 0.0
# V3: 动态阈值配置(替代固定 min_score: 0.0
# 使用短债动量作为动态 min_score标的动量 < 短债动量 → 不持有
bond_threshold:
enabled: true # true=V3动态阈值, false=退化为V2固定阈值
bond_code: "931862.CSI" # 阈值参考标的(短债指数)
ratio: 1.0 # 阈值 = 短债动量 × ratio
fill_bond: true # 选出不足select_num只时用短债填充空余仓位
# ==================== 调仓控制 ====================
# 最低调仓周期(交易日):持仓至少持有 N 天后才允许换仓
rebalance_days: 1

View File

@@ -71,7 +71,8 @@ class RotationStrategy(StrategyBase):
group_mapping=self._group_mapping,
min_score=self.min_score, # 从配置读取,支持动态调整阈值
rebalance_days=self.rebalance_days,
rebalance_threshold=self.rebalance_threshold
rebalance_threshold=self.rebalance_threshold,
bond_threshold_config=self.config.get('bond_threshold', {}) # V3动态阈值配置
)
@classmethod