chore: 修复 .env 注释格式 & 代码格式化

- .env: 第10行添加 # 注释前缀,修复 source .env 命令报错
- simple_rotation.py: is_crash 判断后添加空行,提升可读性

回测结果 (2020-01-10 ~ 2026-06-09):
- 总收益: 241.73% | 年化: 22.10%
- 最大回撤: -16.27% | Sharpe: 1.09
- 调仓次数: 393
This commit is contained in:
2026-06-09 00:39:27 +08:00
parent 5c4aeb75d2
commit e2038ae722
2 changed files with 3 additions and 1 deletions

View File

@@ -504,6 +504,7 @@ class SimpleRotationStrategy:
prices = recent['close'].values[-self.n_days:]
if len(prices) >= 4 and is_crash(prices):
return 0.0
# Dispatch based on factor type
ft = self.config.factor.type
if ft == FactorType.VOL_ADJUSTED_MOMENTUM:
@@ -530,6 +531,7 @@ class SimpleRotationStrategy:
prices = recent['close'].values[-self.n_days:]
if len(prices) >= 4 and is_crash(prices):
return 0.0
if self.config.factor.type == FactorType.VOL_ADJUSTED_MOMENTUM:
return weighted_momentum_score(prices)
# All other factors: use the same score function as ranking