longbridge-portfolio-diagnosis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselongbridge-portfolio-diagnosis
longbridge-portfolio-diagnosis
Prompt-only analysis skill. Pulls live account data and recent price history to give a comprehensive portfolio health-check: concentration, sector mix, currency breakdown, factor tilt, cross-holding correlation, and benchmark deviation.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
仅基于提示词的分析Skill。提取实时账户数据和近期价格历史,提供全面的组合健康检查:集中度、板块构成、货币细分、因子倾向、跨持仓相关性以及基准偏离情况。
回复语言:匹配用户输入语言——简体中文 / 繁体中文 / 英文。
When to use
使用场景
- "帮我诊断一下我的组合" / "組合診斷" / "diagnose my portfolio"
- "我的持仓集中度高吗" / "持倉集中度高嗎" / "check concentration risk"
- "行业分布怎么样" / "行業分布" / "sector distribution in my holdings"
- "货币风险怎么样" / "貨幣敞口" / "currency exposure breakdown"
- "因子暴露分析" / "factor exposure analysis"
- "持仓之间相关性" / "correlation risk across holdings"
- "帮我诊断一下我的组合" / "組合診斷" / "diagnose my portfolio"
- "我的持仓集中度高吗" / "持倉集中度高嗎" / "check concentration risk"
- "行业分布怎么样" / "行業分布" / "sector distribution in my holdings"
- "货币风险怎么样" / "貨幣敞口" / "currency exposure breakdown"
- "因子暴露分析" / "factor exposure analysis"
- "持仓之间相关性" / "correlation risk across holdings"
Workflow
工作流程
- Fetch account data with and
longbridge portfolio.longbridge positions - For correlation analysis, fetch 60-day daily kline for each holding concurrently.
- Compute diagnostics in the LLM (see Calculations section).
- Present a structured diagnosis report.
- 通过和
longbridge portfolio获取账户数据。longbridge positions - 进行相关性分析时,同时获取每只持仓的60日日线数据。
- 在LLM中计算诊断指标(详见计算部分)。
- 生成结构化诊断报告。
CLI
CLI 命令
Run to verify exact flags before calling.
longbridge <subcommand> --helpbash
undefined调用前运行确认具体参数。
longbridge <subcommand> --helpbash
undefinedStep 1: account summary + positions
步骤1:账户汇总 + 持仓信息
longbridge portfolio --format json
longbridge positions --format json
longbridge portfolio --format json
longbridge positions --format json
Step 2: 60-day price history for each holding (run concurrently per symbol)
步骤2:获取每只持仓的60日价格历史(按代码并行运行)
longbridge kline <SYMBOL> --period day --count 60 --format json
longbridge kline <SYMBOL> --period day --count 60 --format json
Step 3: sector/valuation context per holding
步骤3:获取每只持仓的板块/估值背景信息
longbridge calc-index <SYMBOL> --format json
undefinedlongbridge calc-index <SYMBOL> --format json
undefinedCalculations
计算逻辑
Compute the following in the LLM from fetched data:
| Metric | Method |
|---|---|
| Top-5 concentration | Sum of top-5 positions by market value ÷ total portfolio value |
| Sector distribution | Group positions by |
| Currency exposure | Group by currency of listing; compute % of total MV |
| Factor tilt | Large-cap (market cap > $10B) vs small-cap; PE < 15 / dividend yield > 3% = value tilt |
| Pairwise correlation | Pearson correlation of 60-day daily returns; flag pairs with r > 0.8 as high correlation |
| Benchmark deviation | If user provides a benchmark (e.g. SPX, HSI), compare sector weights |
基于获取的数据,在LLM中计算以下指标:
| 指标 | 计算方法 |
|---|---|
| 前5大持仓集中度 | 按市值排名前5的持仓总市值 ÷ 组合总市值 |
| 板块分布 | 按 |
| 货币敞口 | 按上市货币分组;计算各货币占总市值的百分比 |
| 因子倾向 | 大盘股(市值>100亿美元)vs小盘股;市盈率<15 / 股息率>3%视为价值倾向 |
| 两两相关性 | 60日每日收益率的皮尔逊相关系数;相关系数r>0.8的持仓对标记为高相关性 |
| 基准偏离 | 若用户提供基准(如SPX、HSI),对比板块权重差异 |
Output template
输出模板
Portfolio Diagnosis — Source: Longbridge Securities
Date: <today>
[Concentration]
- Top-5 holdings: <names> = <N>% of portfolio
- Risk: {Low (<40%) / Medium (40-60%) / High (>60%)}
[Sector Distribution]
- <Sector>: <N>% (target suggestion if heavily concentrated)
- ...
[Currency Exposure]
- USD: <N>% HKD: <N>% CNY: <N>% Other: <N>%
[Factor Tilt]
- Large-cap: <N>% Small-cap: <N>%
- Value tilt: <N>% Growth tilt: <N>%
[Correlation Risk]
- High-correlation pairs (r > 0.8): <list>
- Diversification note: ...
[Summary & Suggestions]
- Key risks: ...
- Suggested actions: ...
⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice.组合诊断 — 数据源:Longbridge Securities
日期:<今日>
[集中度]
- 前5大持仓:<名称> = 占组合的<N>%
- 风险等级:{低(<40%) / 中(40-60%) / 高(>60%)}
[板块分布]
- <板块>:<N>% (若集中度较高则给出目标建议)
- ...
[货币敞口]
- 美元:<N>% 港币:<N>% 人民币:<N>% 其他:<N>%
[因子倾向]
- 大盘股:<N>% 小盘股:<N>%
- 价值倾向:<N>% 成长倾向:<N>%
[相关性风险]
- 高相关性持仓对(r>0.8):<列表>
- 分散化建议:...
[总结与建议]
- 核心风险:...
- 建议操作:...
⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice.Error handling
错误处理
| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, ask user to install longbridge-terminal. |
stderr | 请运行 | 請運行 | Run |
| Empty positions | 账户暂无持仓,无法诊断 | 賬戶暫無持倉,無法診斷 | No holdings found; cannot run diagnosis. |
| kline data unavailable for a symbol | 跳过该标的相关性计算,标注数据缺失 | 略過該標的相關性計算,標注數據缺失 | Skip correlation for that symbol; note data gap. |
| 场景 | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到MCP;若MCP也不可用,请安装longbridge-terminal | 回退到MCP;若MCP也不可用,請安裝longbridge-terminal | Fall back to MCP; if unavailable, ask user to install longbridge-terminal. |
stderr提示 | 请运行 | 請運行 | Run |
| 无持仓数据 | 账户暂无持仓,无法诊断 | 賬戶暫無持倉,無法診斷 | No holdings found; cannot run diagnosis. |
| 某代码的K线数据不可用 | 跳过该标的相关性计算,标注数据缺失 | 略過該標的相關性計算,標注數據缺失 | Skip correlation for that symbol; note data gap. |
MCP fallback
MCP 降级方案
If CLI is not installed, use MCP tools:
longbridge| MCP tool | CLI equivalent |
|---|---|
| |
| |
| |
| |
MCP setup: ( + scopes).
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcpquotetrade_read若未安装 CLI,可使用MCP工具:
longbridge| MCP工具 | 对应CLI命令 |
|---|---|
| |
| |
| |
| |
MCP配置:(需 + 权限)。
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcpquotetrade_readRelated skills
相关Skill
- Rebalance to target weights →
longbridge-portfolio-rebalance - Risk metrics (VaR, drawdown) →
longbridge-risk-analysis - Asset allocation framework →
longbridge-asset-allocation - Portfolio P&L overview →
longbridge-portfolio
- 按目标权重再平衡 →
longbridge-portfolio-rebalance - 风险指标(VaR、回撤)→
longbridge-risk-analysis - 资产配置框架 →
longbridge-asset-allocation - 组合盈亏概览 →
longbridge-portfolio
File layout
文件结构
longbridge-portfolio-diagnosis/
└── SKILL.md # prompt-only, no scripts/longbridge-portfolio-diagnosis/
└── SKILL.md # 仅含提示词,无scripts/目录