From e2038ae722520da69c60d8546bfc761dac6a4489 Mon Sep 17 00:00:00 2001 From: aszerW Date: Tue, 9 Jun 2026 00:39:27 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=20.env=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=A0=BC=E5=BC=8F=20&=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .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 --- .env | 2 +- rotation/simple_rotation.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 9536579..8c0d9f0 100644 --- a/.env +++ b/.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 diff --git a/rotation/simple_rotation.py b/rotation/simple_rotation.py index 53532db..ad33fb1 100644 --- a/rotation/simple_rotation.py +++ b/rotation/simple_rotation.py @@ -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