seasonal
它能做什么
这项技能检验按日历交易是否有效,例如在某些月份买入。适合相信春季行情或“五月卖出”等规律的交易者。
适用场景
- ✓当你想测试某个季节性想法,例如 A 股的春季行情的时候。
- ✓当你怀疑存在某种工作日规律,例如周一收益较弱的时候。
- ✓当你想把月份信号与星期几的过滤器结合起来的时候。
技能链接
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/seasonal/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检验:如果只在 1 月至 3 月买入这只指数,并在一年中其余时间保持空仓,这种做法是否有效?”
每周 5 个新技能,1 分钟读完。
工作原理
它会设定看涨和看跌的月份或工作日,然后根据日历决定做多、做空或保持空仓。月份和工作日规则可以组合使用,使交易需要两者同时一致才会发生。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Seasonal / Calendar Effect Strategy
Purpose
Uses time-based regularities in financial markets (month effects, day-of-week effects, and similar patterns) to generate trading signals. Examples include the China A-share "spring rally" (January-March) and the "sell in May" effect.
Signal Logic
Month Effect (Default)
- Specified bullish months → go long
- Specified bearish months → go short / stay out
- All other months → stay flat
Day-of-Week Effect (Optional Overlay)
- Monday / Friday effects
- Start-of-month / end-of-month effects
Combined Mode
Month signal × weekday signal; open a position only when both confirm.
Common Calendar Effects Reference
| Effect | Description | Reference Configuration |
|---|---|---|
| Spring rally | Higher probability of gains in China A-shares from January to March | bullish_months=[1,2,3] |
| Sell in May | Weaker performance from May to October | bearish_months=[5,6,7,8,9,10] |
| Year-end effect | Institutional rebalancing in December | bullish_months=[11,12] |
| Monday effect | Lower returns on Mondays | bearish_weekdays=[0] |
| Friday effect | Higher returns on Fridays | bullish_weekdays=[4] |
Parameters
| Parameter | Default | Description |
|---|---|---|
| bullish_months | [1, 2, 3, 11, 12] | Bullish months |
| bearish_months | [5, 6, 7, 8, 9] | Bearish months |
| use_weekday | False | Whether to enable weekday effects |
| bullish_weekdays | [4] | Bullish weekdays (0=Monday, 4=Friday) |
| bearish_weekdays | [0] | Bearish weekdays |
Common Pitfalls
pd.DatetimeIndex.monthstarts from 1 (1=January)pd.DatetimeIndex.weekdaystarts from 0 (0=Monday, 4=Friday)- Seasonal strategies are statistical regularities, not deterministic signals, so pay attention to sample size in backtests
- Neutral months (neither in
bullishnorbearish) should output 0 and must not be skipped
Dependencies
pip install pandas numpy
Signal Convention
1= long (bullish window),-1= short (bearish window),0= stand aside
常见问题
什么是“五月卖出”效应?
这是一种认为市场在五月至十月通常表现较差的观点。该技能可以用一组看跌月份来检验它。
日历规律总是有效的吗?
不一定。日历效应并不可靠,因此在信任它们之前应先用过去的数据进行检验。
我可以用它来交易加密货币或股票吗?
适用于任何标准 OHLCV 格式的价格数据,包括股票、ETF 和加密货币。
详情
作者的原始描述
Seasonal/calendar-effect strategy. Generates trading signals from time-based patterns such as month-of-year effects and day-of-week effects. Suitable for any OHLCV data.
repo: HKUDS/Vibe-Trading
热度
- GitHub 星标
- 37k
- 排名
- #7551
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …