longbridge-sector-rotation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-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
longbridge-capital-flow
. For single-stock valuation route to
longbridge-valuation
.
  • "当前哪些行业最强", "which sectors are leading?", "目前哪些行業最強"
  • "A 股行业轮动到哪了", "sector rotation signal for A-shares"
  • "科技 vs 消费 vs 金融谁在跑赢", "板块动量排名"
  • "强势板块有哪些", "弱势板块", "leading / lagging sectors"
如需个股资金流分析,请跳转至
longbridge-capital-flow
。如需个股估值分析,请跳转至
longbridge-valuation

Workflow

工作流程

  1. 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.
  2. Select representative sector indices or ETFs for the market:
    • A-share: 申万一级行业指数 (SW L1); common symbols like
      801010.SH
      (agriculture),
      801020.SH
      (mining),
      801030.SH
      (chemicals),
      801040.SH
      (steel),
      801050.SH
      (non-ferrous),
      801080.SH
      (electronics),
      801130.SH
      (media),
      801140.SH
      (retail),
      801150.SH
      (F&B),
      801160.SH
      (home appliances),
      801170.SH
      (auto),
      801180.SH
      (property),
      801200.SH
      (retail),
      801710.SH
      (building materials),
      801720.SH
      (construction),
      801730.SH
      (utilities),
      801740.SH
      (defense),
      801750.SH
      (IT),
      801760.SH
      (telecom),
      801770.SH
      (biotech),
      801780.SH
      (financials),
      801790.SH
      (brokers).
    • 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
      ).
  3. Fetch kline data for each sector symbol to compute momentum. Run
    longbridge kline --help
    to verify flags:
    bash
    longbridge kline <SYMBOL> --period day --count 65 --format json
  4. 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
  5. Fetch capital flow for top candidates (up to 5 by momentum):
    bash
    longbridge capital <SYMBOL> --flow --format json
  6. Fetch industry valuation for context:
    bash
    longbridge industry-valuation <SYMBOL> --format json
    Run
    longbridge industry-valuation --help
    if unsure of flags.
  7. Score and rank: combine momentum (60%), capital flow direction (25%), valuation discount vs history (15%). Sort descending.
  8. Output the rotation table (see Output section). Cite Longbridge Securities.
  1. 明确范围——若用户未指定市场(A股/港股/美股)和时间窗口(20日/60日),请询问用户。默认设置:A股,20日动量。
  2. 为所选市场选取代表性行业指数或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
      )。
  3. 获取K线数据:为每个行业代码获取K线数据以计算动量。运行
    longbridge kline --help
    查看参数说明:
    bash
    longbridge kline <SYMBOL> --period day --count 65 --format json
  4. 计算动量得分:为每个行业计算动量得分(LLM上下文内计算):
    • 20日收益率:
      (close[-1] / close[-20]) - 1
    • 60日收益率:
      (close[-1] / close[-60]) - 1
  5. 获取资金流数据:为动量排名前5的候选行业获取资金流数据:
    bash
    longbridge capital <SYMBOL> --flow --format json
  6. 获取行业估值数据:用于背景参考:
    bash
    longbridge industry-valuation <SYMBOL> --format json
    若不确定参数,请运行
    longbridge industry-valuation --help
  7. 评分与排名:结合动量(60%)、资金流方向(25%)、相对历史估值折扣(15%)进行综合评分,按降序排序。
  8. 输出轮动表格(见输出部分)。注明数据来源为Longbridge Securities。

CLI

命令行界面(CLI)

Run
--help
before calling any subcommand if unsure of flags.
bash
undefined
调用任何子命令前,若不确定参数,请运行
--help
查看说明。
bash
undefined

Step 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
undefined
longbridge kline XLK.US --period day --count 65 --format json longbridge capital XLK.US --flow --format json
undefined

Output

输出格式

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
command not found: longbridge
回退到 MCP;否则告知用户安装 longbridge-terminal回退到 MCP;否則告知用戶安裝 longbridge-terminalFall back to MCP; otherwise tell user to install longbridge-terminal.
stderr
not logged in
请运行
longbridge auth login
請執行
longbridge auth login
Run
longbridge auth login
.
kline returns < 60 bars动量计算退化为可用历史動量計算退化為可用歷史Degrade momentum to available history length.
Other stderr原文显示错误原文顯示錯誤Surface verbatim.
场景简体中文繁体中文English
command not found: longbridge
回退到MCP;否则告知用户安装longbridge-terminal回退到MCP;否則告知用戶安裝longbridge-terminalFall back to MCP; otherwise tell user to install longbridge-terminal.
stderr
not logged in
请运行
longbridge auth login
請執行
longbridge auth login
Run
longbridge auth login
.
kline返回数据不足60条动量计算退化为可用历史数据长度動量計算退化為可用歷史數據長度Degrade momentum to available history length.
其他stderr错误显示原始错误信息顯示原始錯誤信息Surface verbatim.

MCP fallback

MCP fallback映射

CLI subcommandMCP tool
kline <SYMBOL> --period day
mcp__longbridge__security_candlesticks
capital <SYMBOL> --flow
mcp__longbridge__capital_flow
industry-valuation <SYMBOL>
mcp__longbridge__industry_valuation
CLI子命令MCP工具
kline <SYMBOL> --period day
mcp__longbridge__security_candlesticks
capital <SYMBOL> --flow
mcp__longbridge__capital_flow
industry-valuation <SYMBOL>
mcp__longbridge__industry_valuation

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/目录