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:
2
.env
2
.env
@@ -7,7 +7,7 @@ TUSHARE_TOKEN=725296d48ec74da89422e8be76bd770895a4bf93b4998aca4b898db6
|
||||
DINGTALK_WEBHOOK_1=https://oapi.dingtalk.com/robot/send?access_token=fb70c1561d8beba94b4f11568f4bb15e3ae07ccbdc8ac19676434a9d1cd17546
|
||||
DINGTALK_SECRET_1=SEC1ae7cd2f1a6f9da3611af37da3e7d954c1e8533fc073c6c8cc5e5af3b6e5926b
|
||||
|
||||
钉钉机器人配置 - 群2
|
||||
# 钉钉机器人配置 - 群2
|
||||
DINGTALK_WEBHOOK_2=https://oapi.dingtalk.com/robot/send?access_token=87c7abfcdd69b699c32da4e4f5981cd2ca6b0445474fc6ffb36f2ed0f6262fbb
|
||||
DINGTALK_SECRET_2=SECf3d6b43f2f8a87ab91feffd052e71ec314fbf57a1842e483fe07af3c0a0e5aa6
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user