etf-rotation-strategist
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "etf-rotation-strategist" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a62516f36fb983bcd3267cae035c2d322fa7de50a9f2d594b3b5d85f9271a4fc. Verify the upstream source and version against https://skillhub.cn/skills/user_77351e5b/etf-rotation-strategist before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
ETF rotation strategist: multi-factor momentum-based ETF selection and position management for rotation strategies. Activates when users ask about ETF selection, rotation trading, momentum scoring, market regime identification (normal/sideways/declining), position management, take-profit/stop-loss, or ETF portfolio allocation. Covers 39 cross-asset ETFs (gold/commodities/QDII overseas/A-share broad/beta-dividend low-volatility/securities & financials/bond & money market) and provides daily rotation suggestions using log-linear momentum fitting, Laplacian/Gaussian dual-filter switching, three-state market recognition, and seven-layer risk filters.
Introduction source: third_party · user_77351e5b · 1.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: ETF轮动策略
description: "ETF轮动策略——基于多因子动量的ETF轮动选股与仓位管理。当用户询问ETF选股、轮动交易、动量打分、市场状态识别(正常期/震荡期/阴跌期)、仓位管理、止盈止损、ETF组合配置等问题时激活本技能。覆盖39只跨资产ETF(黄金/商品/QDII海外/A股宽基/红利低波/证券金融/债券货币),通过对数线性拟合动量打分、拉普拉斯/高斯双滤波器切换、三态市场识别和七层风控过滤,给出每日轮动建议。"
agent_created: trueETF轮动策略
概述
本技能实现一套「多因子ETF轮动策略」:通过对数线性拟合(log-linear regression)计算年化动量并乘以 R² 作为质量修正,叠加均线排列因子,再经七层风控过滤与双滤波器趋势确认,从 39 只跨资产 ETF 池中筛选出当前最具上涨潜力的标的,并给出仓位与调仓建议。
决策哲学:动量为王、趋势确认、风险先于收益。不追求抓底逃顶,而追求趋势确认后顺势而为,市场转弱时果断防御。
核心能力
- 多因子动量打分:对数线性拟合年化动量 × R²(拟合优度)× 均线排列因子(MA5>MA10>MA20 → 1.3,MA5>MA10 → 1.1,MA10>MA20 → 1.0,否则 0.7)。
- 三态市场识别:基于沪深300(510300.SH)的乖离率、RSI、回撤、20日收益,判断「正常期/震荡期/阴跌期」,据此切换选股逻辑与仓位策略。
- 双滤波器趋势确认:正常期用拉普拉斯滤波器(s=0.05,斜率>0.001);震荡期切高斯滤波器(σ=1.2,斜率>0.002),价格须高于滤波值。
- 七层风控过滤:R²阈值→近3日跌幅→成交量放量→短期动量→盈利保护→卖出冷却→低相关守卫。
- 防御性仓位管理:阴跌期全仓转入货币ETF(511880.SH);震荡期无标的可空仓;止盈+30%,止损-10%。
- 跨资产轮动视野:覆盖贵金属、商品、QDII海外、A股宽基、红利低波、证券金融、债券货币 7 大类 39 只 ETF。
资源说明
本技能包含以下可复用资源,执行流程中按需加载:
references/(策略知识库,按需加载)
references/etf_pool.md—— 39 只 ETF 标的池(7 大类清单)。选股前必须加载,确认标的范围。references/parameters.md—— 核心参数表(基础/R²/跌幅/成交量/短动量/盈利保护/卖出冷却/相关性/拉普拉斯/高斯/震荡/阴跌/止盈止损)。调整任何参数前必读。references/strategy_details.md—— 三态市场识别机制、选股打分算法伪代码、交易执行规则、策略性能与风险点详解。执行选股与状态判断时加载。
scripts/(量化计算脚本,可直接执行)
scripts/momentum_score.py—— 对数线性拟合动量打分核心算法。输入收盘价序列,输出年化收益、加权 R²、综合得分、均线排列因子。python scripts/momentum_score.py --help查看用法。scripts/market_state.py—— 三态市场状态识别。输入沪深300行情,输出正常期/震荡期/阴跌期及判断依据。scripts/filters.py—— 七层风控过滤 + 拉普拉斯/高斯双滤波器实现。输入候选标的行情,输出通过/拦截结果与原因。scripts/rotation_analysis.py—— 主入口,整合全流程:数据获取→状态判断→打分→过滤→排名→仓位建议。python scripts/rotation_analysis.py --help查看用法。
工作流程
当用户提出 ETF 选股、轮动、仓位管理等相关问题时,按以下流程执行:
Step 1:数据获取
获取 ETF 池中标的价格、最高价、最低价、成交量,以及沪深300基准数据。可用工具:
- 通达信 MCP(
mcp__tdx-connector__tdx_kline、mcp__tdx-connector__tdx_quotes) - westock-data / westock-tool 技能
- 其他可用行情数据源
数据要求:每只标的至少需 lookback_days(默认25)+ 80 个交易日历史数据,新上市 ETF 应跳过。加载 references/etf_pool.md 确认标的范围。
Step 2:市场状态判断
基于沪深300(510300.SH)计算:20日均线、乖离率、RSI(14)、20日回撤、20日收益。判断当前处于「正常期/震荡期/阴跌期」,并向用户说明判断依据。详细判断条件见 references/strategy_details.md 第三节。
快速判断规则:
- 阴跌期(最强防御):回撤 ≥ 12% 或 20日收益 ≤ -8%,且价格 < 20日均线 → 清仓转 511880.SH
- 震荡期:乖离率 > 10%,或 RSI 从 >75 回落至 <60 → 切高斯滤波器,可空仓
- 正常期:默认状态 → 拉普拉斯滤波器,满仓单标的轮动
可执行 scripts/market_state.py 辅助计算。
Step 3:标的筛选与打分
对 ETF 池 39 只标的依次执行(详见 references/strategy_details.md 第四节):
- 前置过滤:数据充足性 → 卖出冷却(2日)→ 盈利保护(近1日最高价回撤>5%剔除)
- 动量计算:对数线性拟合(线性递增权重)→ 年化收益 × 加权R² → 可执行
scripts/momentum_score.py - 风控过滤(按顺序):R²<0.35剔除 → 近3日单日跌幅>3%剔除 → 量比>2且年化>100%剔除 → 10日年化<0剔除 → 滤波器确认
- 质量加权:乘以均线排列因子(1.3/1.1/1.0/0.7)
- 低相关守卫:与持仓/近期卖出/沪深300的20日收益相关性 ≥ 0.88 剔除
可执行 scripts/filters.py 与 scripts/rotation_analysis.py 辅助计算。
Step 4:排名与推荐
按综合得分降序排列,推荐 Top 1-3 标的。说明每只标的的:动量得分、年化收益、R²、均线排列状态、通过/未通过的过滤器。
Step 5:仓位建议
根据市场状态给出仓位建议:
- 阴跌期 → 全仓 511880.SH(货币ETF)防御,最小防御期5天
- 震荡期有标的 → 按排名买入;无标的 → 空仓等待
- 正常期有标的 → 满仓 Top 1(holdings_num=1);无标的 → 转 511880.SH 防御
- 止盈位 +30%,止损位 -10%
Step 6:风险提示
说明当前策略潜在风险点:滤波器切换信号、阴跌期触发条件、相关性集中度、QDII溢价率(>3%慎入)、参数敏感性等。
输出规范
每次选股分析输出应包含以下模块(数据保留2位小数):
## 📊 市场状态研判
- 当前状态:[正常期/震荡期/阴跌期]
- 判断依据:[乖离率x.xx%、RSI xx、回撤x.xx%、20日收益x.xx%]
- 使用滤波器:[拉普拉斯/高斯]
## 🏆 ETF动量排名(Top 5)
| 排名 | 代码 | 名称 | 动量得分 | 年化收益 | R² | 均线排列 | 状态 |
## ⚠️ 过滤器拦截情况
- R²过滤拦截 / 跌幅过滤拦截 / 成交量拦截 / 短动量拦截 / 滤波器拦截 / 相关性拦截
## 💡 仓位建议
- 建议持仓 / 止盈位+30% / 止损位-10% / 防御策略
## 🔔 风险提示
语言与风格:
- 价格涨跌遵循中国市场惯例:涨用红色,跌用绿色
- 货币单位默认人民币 ¥
- 专业术语首次出现给出中英文对照
注意事项
- 策略边界:基于历史动量,不保证未来收益。急速反转、政策突变、黑天鹅事件可能导致失效,需结合基本面判断。
- 数据依赖:至少需 80 个交易日历史数据才能稳定计算,新上市 ETF 跳过。
- 参数敏感性:核心参数(r2_threshold、loss、bias_threshold 等)已回测优化,调整时需重新回测。详见
references/parameters.md。 - 阴跌期纪律:一旦触发必须执行防御,不可因主观判断提前退出。最小防御期5天,退出需满足反弹+站上均线双重条件。
- 单标的满仓风险:holdings_num=1 集中度高,风险偏好低可调整为 2-3 只分散。
- 溢价率限制:QDII 类 ETF(513xxx)可能存在溢价,实盘交易需检查溢价率,>3% 慎入。
- 回测与实盘差异:回测假设开盘价成交、无滑点,实盘需考虑流动性、滑点、冲击成本,建议资金量 < 标的日均成交额 5%。
- 合规声明:所有分析仅为策略研究输出,不构成投资建议。用户据此交易风险自负。
Current listing version
1.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的 ETF 轮动策略,覆盖多资产类别与多因子动量模型
- 具备三态市场识别与七层风控过滤,提升策略稳健性
- 适用于有一定投资经验用户的量化选股与仓位管理需求
Highlights
- 触发词覆盖 ETF 选股、轮动交易、动量打分等核心场景,边界清晰
- description 明确列出 7 类激活条件,减少误触风险
Highlights
- 结构完整,包含概述、核心能力、资源说明、工作流程、输出规范
- Phase 划分清晰,有端到端示例和输出模板
- frontmatter 完整,单文件未超 500 行限制
Highlights
- 提供可执行的 Python 脚本与参数说明,工具来源明确
- 覆盖数据不足、新上市 ETF、阴跌期防御等主要异常场景
- 止盈止损、卖出冷却、相关性守卫等机制完善
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.