longbridge-risk-return
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselongbridge-risk-return
longbridge-risk-return
Risk-return optimisation — evaluate portfolio efficiency versus the efficient frontier and recommend optimal asset allocation.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
风险收益优化——评估投资组合相对于有效前沿的效率,并推荐最优资产配置。
响应语言:匹配用户输入语言——简体中文/繁体中文/英文。
When to use
使用场景
Trigger on prompts asking for:
- Portfolio optimisation — "帮我优化投资组合", "optimal portfolio", "投资组合优化"
- Efficient frontier analysis — "有效前沿", "efficient frontier", "组合效率"
- Risk preference-based allocation — "稳健型配置", "aggressive allocation", "风险偏好配置"
- Risk-adjusted return improvement — "提高夏普比率", "risk-adjusted return", "大类资产配置"
Requires Longbridge login with Trade scope for account data.
当用户提出以下需求时触发:
- 投资组合优化——"帮我优化投资组合", "optimal portfolio", "投资组合优化"
- 有效前沿分析——"有效前沿", "efficient frontier", "组合效率"
- 基于风险偏好的配置——"稳健型配置", "aggressive allocation", "风险偏好配置"
- 提升风险调整后收益——"提高夏普比率", "risk-adjusted return", "大类资产配置"
需要登录Longbridge并授予Trade权限以获取账户数据。
Workflow
工作流程
- Fetch current portfolio and positions.
- Ask the user for:
- Risk preference: Conservative (低风险) / Balanced (稳健) / Aggressive (进取)
- Investment horizon: short (1–2y) / medium (3–5y) / long (5y+)
- Any constraints: max single-stock weight, excluded asset classes
- Fetch 1-year daily return history for each position.
- Compute:
- Current portfolio: expected return, volatility, Sharpe ratio, max drawdown
- Correlation matrix of holdings
- Efficient frontier points (using simplified mean-variance framework)
- Recommended target allocation for the user's risk profile
- Compute the Efficiency Gap: distance from current portfolio to the nearest efficient frontier point.
- Output target weights and rebalancing actions.
- Convert multi-currency positions using FX rates.
If unsure of exact flag names, runbefore proceeding.longbridge <subcommand> --help
- 获取当前投资组合及持仓情况。
- 向用户询问:
- 风险偏好:保守(低风险)/平衡(稳健)/进取(进取)
- 投资期限:短期(1–2年)/中期(3–5年)/长期(5年以上)
- 约束条件:单只股票最大权重、排除的资产类别
- 获取每个持仓标的1年的每日收益历史数据。
- 计算:
- 当前投资组合:预期收益、波动率、夏普比率、最大回撤
- 持仓标的的相关矩阵
- 有效前沿点(使用简化的均值-方差框架)
- 符合用户风险偏好的目标配置建议
- 计算效率缺口:当前投资组合与最近的有效前沿点之间的距离。
- 输出目标权重和调仓操作建议。
- 使用汇率转换多币种持仓。
若不确定具体命令参数,请先运行。longbridge <subcommand> --help
CLI
CLI
bash
undefinedbash
undefinedAccount portfolio summary
账户投资组合摘要
longbridge portfolio --format json
longbridge portfolio --format json
Current positions
当前持仓
longbridge positions --format json
longbridge positions --format json
1-year daily OHLCV per holding (run for each symbol)
单个持仓标的1年每日OHLCV数据(每个代码运行一次)
longbridge kline <SYMBOL> --period day --count 252 --format json
longbridge kline <SYMBOL> --period day --count 252 --format json
FX rates for currency normalisation
用于币种归一化的汇率
longbridge exchange-rate --format json
undefinedlongbridge exchange-rate --format json
undefinedOutput structure
输出结构
RISK-RETURN OPTIMISATION <Date>
RISK PROFILE: [Conservative | Balanced | Aggressive]
Horizon: x years
CURRENT PORTFOLIO
Expected Return: x.x% p.a. Volatility: x.x% p.a.
Sharpe Ratio: x.xx Max Drawdown: -x.x%
Efficiency Score: xx/100 (distance from efficient frontier)
EFFICIENT FRONTIER TARGETS
Conservative Balanced Aggressive
Expected Return x.x% x.x% x.x%
Volatility x.x% x.x% x.x%
Sharpe x.xx x.xx x.xx
RECOMMENDED ALLOCATION (for your profile)
Equities: xx% (current: xx%)
Bonds / Fixed: xx% (current: xx%)
Cash: xx% (current: xx%)
Commodities/Alt: xx% (current: xx%)
CONCENTRATION RISK
Top holdings by weight:
1. <SYMBOL> xx% → Recommend: reduce to xx%
2. ...
REBALANCING ACTIONS
• Buy: <SYMBOL> +$x,xxx
• Sell: <SYMBOL> -$x,xxx
• No action: <SYMBOL>RISK-RETURN OPTIMISATION <日期>
风险偏好:[保守 | 平衡 | 进取]
投资期限:x年
当前投资组合
预期收益: x.x% 年化 波动率:x.x% 年化
夏普比率: x.xx 最大回撤:-x.x%
效率得分:xx/100 (与有效前沿的距离)
有效前沿目标值
保守型 平衡型 进取型
预期收益 x.x% x.x% x.x%
波动率 x.x% x.x% x.x%
夏普比率 x.xx x.xx x.xx
推荐配置(匹配您的风险偏好)
股票: xx% (当前:xx%)
债券/固定收益: xx% (当前:xx%)
现金: xx% (当前:xx%)
大宗商品/另类资产:xx% (当前:xx%)
集中度风险
按权重排序的前十大持仓:
1. <代码> xx% → 建议:降至xx%
2. ...
调仓操作建议
• 买入:<代码> +$x,xxx
• 卖出:<代码> -$x,xxx
• 无需操作:<代码>Error handling
错误处理
| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| Not logged in | 请运行 | 請執行 | Run |
| Insufficient history for a holding | 部分持仓历史数据不足,已使用市场代理替代。 | 部分持倉歷史數據不足,已使用市場代理替代。 | Insufficient history for some holdings — market proxy used. |
| Empty portfolio | 账户暂无持仓。 | 賬戶暫無持倉。 | No positions found in the account. |
| 请安装 longbridge-terminal 或通过 MCP 连接。 | 請安裝 longbridge-terminal 或透過 MCP 連線。 | Install longbridge-terminal or connect via MCP. |
| 场景 | 简体回复 | 繁体回复 | English reply |
|---|---|---|---|
| 未登录 | 请运行 | 請執行 | Run |
| 部分持仓历史数据不足 | 部分持仓历史数据不足,已使用市场代理替代。 | 部分持倉歷史數據不足,已使用市場代理替代。 | Insufficient history for some holdings — market proxy used. |
| 空投资组合 | 账户暂无持仓。 | 賬戶暫無持倉。 | No positions found in the account. |
| 请安装longbridge-terminal或通过MCP连接。 | 請安裝longbridge-terminal或透過MCP連線。 | Install longbridge-terminal or connect via MCP. |
MCP fallback
MCP fallback
If binary is not found, fall back to , , , and .
longbridgemcp__longbridge__portfoliomcp__longbridge__positionsmcp__longbridge__klinemcp__longbridge__exchange_rate若未找到二进制文件,可 fallback 至, , , 和。
longbridgemcp__longbridge__portfoliomcp__longbridge__positionsmcp__longbridge__klinemcp__longbridge__exchange_rateRelated skills
相关技能
- — account P&L and current allocation
longbridge-portfolio - — holdings detail
longbridge-positions - — retirement and savings goals
longbridge-financial-planning - — strategy-level optimisation
longbridge-strategy-optimizer
- — 账户盈亏及当前配置
longbridge-portfolio - — 持仓详情
longbridge-positions - — 退休及储蓄目标规划
longbridge-financial-planning - — 策略层面优化
longbridge-strategy-optimizer
File layout
文件结构
skills/longbridge-risk-return/
└── SKILL.mdskills/longbridge-risk-return/
└── SKILL.md