longbridge-asset-allocation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselongbridge-asset-allocation
longbridge-asset-allocation
Prompt-only analysis skill. Explains major asset-allocation frameworks (MPT efficient frontier, Black-Litterman, risk parity, all-weather) and, when the user is logged in, applies them to their actual Longbridge portfolio data.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
纯Prompt分析Skill。讲解主流资产配置框架(MPT有效前沿、Black-Litterman、风险平价、全天候策略),当用户登录后,会将这些框架应用到其实际的Longbridge组合数据中。
回复语言:匹配用户输入语言——简体中文/繁体中文/英文。
When to use
使用场景
- "帮我做资产配置分析" / "資產配置分析" / "help me with asset allocation"
- "什么是有效前沿" / "有效前沿" / "explain the efficient frontier"
- "Black-Litterman 模型怎么用" / "Black-Litterman model"
- "风险平价策略" / "風險平價策略" / "risk parity strategy"
- "全天候策略怎么配置" / "全天候策略" / "all-weather portfolio allocation"
- "帮我优化组合配置" / "optimize my portfolio allocation"
- "帮我做资产配置分析" / "資產配置分析" / "help me with asset allocation"
- "什么是有效前沿" / "有效前沿" / "explain the efficient frontier"
- "Black-Litterman 模型怎么用" / "Black-Litterman model"
- "风险平价策略" / "風險平價策略" / "risk parity strategy"
- "全天候策略怎么配置" / "全天候策略" / "all-weather portfolio allocation"
- "帮我优化组合配置" / "optimize my portfolio allocation"
Workflow
工作流程
- Framework selection: identify which allocation approach the user wants (MPT / Black-Litterman / risk parity / all-weather / practical advice).
- Account data (if logged in): fetch current positions and 252-day price history for each holding.
- Explain the framework with the user's actual holdings as context.
- Generate suggested target weights based on the chosen framework.
- Present the allocation with rationale.
- 框架选择:确定用户想要的配置方法(MPT / Black-Litterman / 风险平价 / 全天候 / 实用建议)。
- 账户数据(若已登录):获取当前持仓及每个标的的252日价格历史数据。
- 结合用户实际持仓讲解框架。
- 基于所选框架生成建议目标权重。
- 呈现配置方案及理由。
CLI
CLI 命令
Run to verify exact flags before calling.
longbridge <subcommand> --helpbash
undefined调用前请运行 确认具体参数。
longbridge <subcommand> --helpbash
undefinedCurrent holdings (if user is logged in)
当前持仓(若用户已登录)
longbridge portfolio --format json
longbridge positions --format json
longbridge portfolio --format json
longbridge positions --format json
252-day daily price history for each holding (run concurrently; ~1 year for covariance)
每个标的的252日每日价格历史数据(并发运行;约1年数据用于计算协方差)
longbridge kline <SYMBOL> --period day --count 252 --format json
longbridge kline <SYMBOL> --period day --count 252 --format json
Optional: valuation context
可选:估值参考
longbridge calc-index <SYMBOL> --format json
undefinedlongbridge calc-index <SYMBOL> --format json
undefinedFramework Reference
框架参考
MPT (Modern Portfolio Theory)
MPT(现代投资组合理论)
- Compute expected return (historical mean daily return × 252) and covariance matrix from 252-day returns.
- Find minimum-variance portfolio and tangency portfolio (max Sharpe).
- Caution: MPT is sensitive to input estimation error; treat outputs as directional, not prescriptive.
- 根据252日收益率计算预期收益(历史日均收益率×252)和协方差矩阵。
- 找到最小方差组合和切点组合(夏普比率最大化)。
- 注意:MPT对输入估计误差敏感;输出仅作方向性参考,而非指令性建议。
Black-Litterman
Black-Litterman
- Start from market-cap equilibrium weights (CAPM implied returns).
- Blend user's views (e.g. "I expect TSLA to outperform by 5%") via Bayesian update.
- Output: posterior expected returns + revised weights.
- Explain conceptually; provide numeric illustration when user supplies explicit views.
- 从市值均衡权重(CAPM隐含收益率)出发。
- 通过贝叶斯更新融合用户观点(例如:"我预期TSLA将跑赢大盘5%")。
- 输出:后验预期收益率 + 调整后的权重。
- 从概念上进行讲解;当用户提供明确观点时,提供数值示例。
Risk Parity
风险平价
- Allocate so each asset contributes equally to total portfolio volatility.
- Approximate weight ∝ 1 / volatility (simplified). For full risk parity use covariance.
- Result: typically overweights low-volatility assets (bonds, gold) vs equities.
- 配置权重使每个资产对组合总波动率的贡献相等。
- 近似权重 ∝ 1 / 波动率(简化版)。完整风险平价需使用协方差。
- 结果:通常会低配股票,高配低波动率资产(债券、黄金)。
All-Weather (Bridgewater style)
全天候策略(桥水风格)
- 4 economic quadrants: growth up/down × inflation up/down.
- Suggested weight guidance: 30% equities, 40% long bonds, 15% intermediate bonds, 7.5% gold, 7.5% commodities.
- Map user's holdings to quadrant exposure; identify gaps.
- 4个经济象限:增长上行/下行 × 通胀上行/下行。
- 建议权重指引:30%股票、40%长期债券、15%中期债券、7.5%黄金、7.5%大宗商品。
- 将用户持仓映射到象限敞口,识别配置缺口。
Output template
输出模板
Asset Allocation Analysis — Source: Longbridge Securities
Framework: <MPT / Black-Litterman / Risk Parity / All-Weather / Practical>
Date: <today>
[Current Portfolio]
Asset Weight Expected Return Volatility (ann.)
<symbol> <N>% <N>% <N>%
...
[Suggested Allocation — <Framework>]
Asset Target Weight Rationale
<symbol> <N>% <reason>
...
[Key Metrics]
- Portfolio expected return (ann.): N%
- Portfolio volatility (ann.): N%
- Sharpe ratio (rf=4%): N
[Caveats]
- Historical returns do not guarantee future results.
- Covariance estimates are noisy over short windows.
- <framework-specific caveats>
⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice.资产配置分析 — 来源:Longbridge Securities
框架:<MPT / Black-Litterman / 风险平价 / 全天候 / 实用建议>
日期:<今日>
[当前组合]
资产 权重 预期收益率 年化波动率
<symbol> <N>% <N>% <N>%
...
[建议配置方案 — <框架>]
资产 目标权重 理由
<symbol> <N>% <说明>
...
[关键指标]
- 组合年化预期收益率:N%
- 组合年化波动率:N%
- 夏普比率(无风险利率=4%):N
[注意事项]
- 历史收益不代表未来表现。
- 短期窗口的协方差估算存在误差。
- <框架特定注意事项>
⚠️ 仅供参考,不构成投资建议。/ 僅供參考,不構成投資建議。/ For reference only. Not investment advice.Error handling
错误处理
| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. |
stderr | 未登录时将使用用户指定的标的做示例分析 | 未登入時將使用用戶指定的標的做示例分析 | Not logged in — will analyse user-specified symbols instead. |
| Price history < 60 days | 数据不足,降级为简单波动率估算 | 數據不足,降級為簡單波動率估算 | Insufficient history; degrade to simple volatility estimate. |
| No positions and no symbols given | 请提供要分析的标的或登录账户 | 請提供要分析的標的或登入賬戶 | Please provide symbols to analyse or log in to your account. |
| 场景 | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到MCP;若MCP也不可用,请安装longbridge-terminal | 回退到MCP;若MCP也不可用,請安裝longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. |
stderr | 未登录时将使用用户指定的标的做示例分析 | 未登入時將使用用戶指定的標的做示例分析 | Not logged in — will analyse user-specified symbols instead. |
| 价格历史数据 < 60天 | 数据不足,降级为简单波动率估算 | 數據不足,降級為簡單波動率估算 | Insufficient history; degrade to simple volatility estimate. |
| 无持仓且未提供标的 | 请提供要分析的标的或登录账户 | 請提供要分析的標的或登入賬戶 | Please provide symbols to analyse or log in to your account. |
MCP fallback
MCP 降级方案
If CLI is not installed, use MCP tools:
longbridge| MCP tool | CLI equivalent |
|---|---|
| |
| |
| |
| |
MCP setup: ( scope; for account data).
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 a new target →
longbridge-portfolio-rebalance - Portfolio health-check →
longbridge-portfolio-diagnosis - Risk metrics (VaR, drawdown) →
longbridge-risk-analysis
- 重新平衡至新目标 →
longbridge-portfolio-rebalance - 组合健康检查 →
longbridge-portfolio-diagnosis - 风险指标(VaR、回撤) →
longbridge-risk-analysis
File layout
文件结构
longbridge-asset-allocation/
└── SKILL.md # prompt-only, no scripts/longbridge-asset-allocation/
└── SKILL.md # 纯Prompt实现,无scripts/目录