longbridge-sector-rotation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselongbridge-sector-rotation
longbridge-sector-rotation
Multi-factor sector-rotation scanner. Combines price momentum, capital flow, and valuation to rank industries by cycle leadership across A-share, HK, and US markets.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
多因子行业轮动扫描工具。结合价格动量、资金流和估值,对A股、港股及美股市场的行业按周期领先性进行排名。
响应语言:匹配用户输入语言——简体中文 / 繁体中文 / 英文。
When to use
使用场景
- "当前哪些行业最强", "which sectors are leading?", "目前哪些行業最強"
- "A 股行业轮动到哪了", "sector rotation signal for A-shares"
- "科技 vs 消费 vs 金融谁在跑赢", "板块动量排名"
- "强势板块有哪些", "弱势板块", "leading / lagging sectors"
For single-stock capital flow route to . For single-stock valuation route to .
longbridge-capital-flowlongbridge-valuation- "当前哪些行业最强", "which sectors are leading?", "目前哪些行業最強"
- "A 股行业轮动到哪了", "sector rotation signal for A-shares"
- "科技 vs 消费 vs 金融谁在跑赢", "板块动量排名"
- "强势板块有哪些", "弱势板块", "leading / lagging sectors"
如需个股资金流分析,请跳转至。如需个股估值分析,请跳转至。
longbridge-capital-flowlongbridge-valuationWorkflow
工作流程
- Clarify scope — ask the user for market (A-share / HK / US) and time window (20-day / 60-day) if not given. Default: A-share, 20-day momentum.
- Select representative sector indices or ETFs for the market:
- A-share: 申万一级行业指数 (SW L1); common symbols like (agriculture),
801010.SH(mining),801020.SH(chemicals),801030.SH(steel),801040.SH(non-ferrous),801050.SH(electronics),801080.SH(media),801130.SH(retail),801140.SH(F&B),801150.SH(home appliances),801160.SH(auto),801170.SH(property),801180.SH(retail),801200.SH(building materials),801710.SH(construction),801720.SH(utilities),801730.SH(defense),801740.SH(IT),801750.SH(telecom),801760.SH(biotech),801770.SH(financials),801780.SH(brokers).801790.SH - HK: use sector ETFs or HSI sub-indices.
- US: use SPDR sector ETFs (,
XLK.US,XLF.US,XLE.US,XLV.US,XLY.US,XLI.US,XLP.US,XLB.US,XLRE.US,XLU.US).XLC.US
- A-share: 申万一级行业指数 (SW L1); common symbols like
- Fetch kline data for each sector symbol to compute momentum. Run to verify flags:
longbridge kline --helpbashlongbridge kline <SYMBOL> --period day --count 65 --format json - Compute momentum score for each sector (LLM in-context):
- 20-day return:
(close[-1] / close[-20]) - 1 - 60-day return:
(close[-1] / close[-60]) - 1
- 20-day return:
- Fetch capital flow for top candidates (up to 5 by momentum):
bash
longbridge capital <SYMBOL> --flow --format json - Fetch industry valuation for context:
Runbash
longbridge industry-valuation <SYMBOL> --format jsonif unsure of flags.longbridge industry-valuation --help - Score and rank: combine momentum (60%), capital flow direction (25%), valuation discount vs history (15%). Sort descending.
- Output the rotation table (see Output section). Cite Longbridge Securities.
- 明确范围——若用户未指定市场(A股/港股/美股)和时间窗口(20日/60日),请询问用户。默认设置:A股,20日动量。
- 为所选市场选取代表性行业指数或ETF:
- A股:申万一级行业指数(SW L1);常见代码如(农林牧渔)、
801010.SH(采掘)、801020.SH(化工)、801030.SH(钢铁)、801040.SH(有色金属)、801050.SH(电子)、801080.SH(传媒)、801130.SH(商贸零售)、801140.SH(食品饮料)、801150.SH(家用电器)、801160.SH(汽车)、801170.SH(房地产)、801180.SH(零售)、801200.SH(建筑材料)、801710.SH(建筑装饰)、801720.SH(公用事业)、801730.SH(国防军工)、801740.SH(计算机)、801750.SH(通信)、801760.SH(医药生物)、801770.SH(非银金融)、801780.SH(银行)。801790.SH - 港股:使用行业ETF或恒生指数细分指数。
- 美股:使用SPDR行业ETF(、
XLK.US、XLF.US、XLE.US、XLV.US、XLY.US、XLI.US、XLP.US、XLB.US、XLRE.US、XLU.US)。XLC.US
- A股:申万一级行业指数(SW L1);常见代码如
- 获取K线数据:为每个行业代码获取K线数据以计算动量。运行查看参数说明:
longbridge kline --helpbashlongbridge kline <SYMBOL> --period day --count 65 --format json - 计算动量得分:为每个行业计算动量得分(LLM上下文内计算):
- 20日收益率:
(close[-1] / close[-20]) - 1 - 60日收益率:
(close[-1] / close[-60]) - 1
- 20日收益率:
- 获取资金流数据:为动量排名前5的候选行业获取资金流数据:
bash
longbridge capital <SYMBOL> --flow --format json - 获取行业估值数据:用于背景参考:
若不确定参数,请运行bash
longbridge industry-valuation <SYMBOL> --format json。longbridge industry-valuation --help - 评分与排名:结合动量(60%)、资金流方向(25%)、相对历史估值折扣(15%)进行综合评分,按降序排序。
- 输出轮动表格(见输出部分)。注明数据来源为Longbridge Securities。
CLI
命令行界面(CLI)
Run before calling any subcommand if unsure of flags.
--helpbash
undefined调用任何子命令前,若不确定参数,请运行查看说明。
--helpbash
undefinedStep 1: kline for momentum (repeat per sector symbol)
步骤1:获取K线数据以计算动量(每个行业代码重复执行)
longbridge kline 801750.SH --period day --count 65 --format json
longbridge kline 801750.SH --period day --count 65 --format json
Step 2: capital flow for shortlisted sectors
步骤2:获取入围行业的资金流数据
longbridge capital 801750.SH --flow --format json
longbridge capital 801750.SH --flow --format json
Step 3: industry valuation for context
步骤3:获取行业估值数据用于背景参考
longbridge industry-valuation 801750.SH --format json
longbridge industry-valuation 801750.SH --format json
Sector ETFs for US market
美股市场的行业ETF操作示例
longbridge kline XLK.US --period day --count 65 --format json
longbridge capital XLK.US --flow --format json
undefinedlongbridge kline XLK.US --period day --count 65 --format json
longbridge capital XLK.US --flow --format json
undefinedOutput
输出格式
Render as a ranked table, then a short narrative:
Sector Rotation Snapshot — Source: Longbridge Securities
Market: A-share | Time: YYYY-MM-DD | Momentum window: 20d / 60d
Rank | Sector | 20d Ret | 60d Ret | Capital Flow | Valuation | Signal
-----|-------------|---------|---------|-------------|-----------|-------
1 | IT / 信息技术 | +8.2% | +15.4% | Net inflow | Neutral | ▲ Leader
2 | Healthcare / 医疗卫生 | +5.1% | +11.2% | Net inflow | Low | ▲ Leader
...
10 | Property / 房地产 | -3.4% | -8.0% | Net outflow | High | ▼ Laggard
Narrative: IT and Healthcare are in the leading quadrant with positive momentum and
capital inflows. Property and Utilities are lagging. Rotation signal suggests early-cycle
tilt toward growth sectors.
⚠️ 数据仅供参考,不构成投资建议。/ 數據僅供參考,不構成投資建議。/ For reference only. Not investment advice.先展示排名表格,再附上简短分析:
行业轮动快照 — 数据来源:Longbridge Securities
市场:A股 | 时间:YYYY-MM-DD | 动量窗口:20日 / 60日
排名 | 行业名称 | 20日收益率 | 60日收益率 | 资金流方向 | 估值水平 | 信号
-----|-------------|---------|---------|-------------|-----------|-------
1 | IT / 信息技术 | +8.2% | +15.4% | 净流入 | 中性 | ▲ 领先
2 | Healthcare / 医疗卫生 | +5.1% | +11.2% | 净流入 | 偏低 | ▲ 领先
...
10 | Property / 房地产 | -3.4% | -8.0% | 净流出 | 偏高 | ▼ 落后
分析:信息技术和医疗保健行业处于领先象限,具备正动量和资金净流入。房地产和公用事业行业表现滞后。轮动信号显示当前周期早期应倾向于成长型行业。
⚠️ 数据仅供参考,不构成投资建议。/ 數據僅供參考,不構成投資建議。/ For reference only. Not investment advice.Error handling
错误处理
| Situation | 简体 | 繁體 | English |
|---|---|---|---|
| 回退到 MCP;否则告知用户安装 longbridge-terminal | 回退到 MCP;否則告知用戶安裝 longbridge-terminal | Fall back to MCP; otherwise tell user to install longbridge-terminal. |
stderr | 请运行 | 請執行 | Run |
| kline returns < 60 bars | 动量计算退化为可用历史 | 動量計算退化為可用歷史 | Degrade momentum to available history length. |
| Other stderr | 原文显示错误 | 原文顯示錯誤 | Surface verbatim. |
| 场景 | 简体中文 | 繁体中文 | English |
|---|---|---|---|
| 回退到MCP;否则告知用户安装longbridge-terminal | 回退到MCP;否則告知用戶安裝longbridge-terminal | Fall back to MCP; otherwise tell user to install longbridge-terminal. |
stderr | 请运行 | 請執行 | Run |
| kline返回数据不足60条 | 动量计算退化为可用历史数据长度 | 動量計算退化為可用歷史數據長度 | Degrade momentum to available history length. |
| 其他stderr错误 | 显示原始错误信息 | 顯示原始錯誤信息 | Surface verbatim. |
MCP fallback
MCP fallback映射
| CLI subcommand | MCP tool |
|---|---|
| |
| |
| |
| CLI子命令 | MCP工具 |
|---|---|
| |
| |
| |
Related skills
相关技能
- Single-stock capital flow →
longbridge-capital-flow - Single-stock valuation →
longbridge-valuation - Index constituents →
longbridge-constituent - Multi-symbol comparison →
longbridge-peer-comparison - Market anomalies →
longbridge-anomaly
- 个股资金流分析 →
longbridge-capital-flow - 个股估值分析 →
longbridge-valuation - 指数成分股查询 →
longbridge-constituent - 多标的对比分析 →
longbridge-peer-comparison - 市场异常指标分析 →
longbridge-anomaly
File layout
文件结构
longbridge-sector-rotation/
└── SKILL.md # prompt-only, no scripts/longbridge-sector-rotation/
└── SKILL.md # 仅含提示词,无scripts/目录