Loading...
Loading...
Portfolio rebalancing via Longbridge — analyse weight drift (current vs target), generate a rebalance trade list, factor in transaction costs and tax impact, and output buy/sell recommendations with rationale. Triggers: "再平衡", "组合再平衡", "仓位调整", "目标权重", "权重偏移", "配置调整", "再平衡交易", "再平衡", "組合再平衡", "倉位調整", "目標權重", "權重偏移", "配置調整", "rebalancing", "portfolio rebalance", "target weight", "weight drift", "allocation adjustment", "rebalance trades", "drift threshold".
npx skill4agent add longbridge/skills longbridge-portfolio-rebalanceResponse language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
longbridge <subcommand> --help# Current holdings and portfolio value
longbridge portfolio --format json
longbridge positions --format json
# Current prices for each symbol in portfolio or target list (run concurrently)
longbridge quote <SYMBOL> --format json
# Maximum tradeable quantity (optional, for feasibility check)
longbridge max-qty <SYMBOL> --format json| Quantity | Method |
|---|---|
| Current weight | Position MV ÷ Total portfolio MV |
| Target MV | Total portfolio MV × target weight % |
| Required trade | Target MV − Current MV (positive = buy, negative = sell) |
| Trade quantity | Required trade amount ÷ current price (round to lot size) |
| Drift threshold | Flag if |
| Est. cost | Trade amount × 0.05% (configurable; note this is approximate) |
Portfolio Rebalance Plan — Source: Longbridge Securities
Total Portfolio Value: <MV> <currency>
Date: <today>
[Current vs Target Weights]
Symbol Current% Target% Drift Action Qty Est.Cost
AAPL.US 35.2% 30.0% +5.2% SELL 12 $1,840 ~$0.9
TSLA.US 12.1% 20.0% -7.9% BUY 8 $2,100 ~$1.1
CASH 52.7% 50.0% +2.7% — — —
[Trade Summary]
- Total buys: $X,XXX (~$X.XX in fees)
- Total sells: $X,XXX (~$X.XX in fees)
- Net cash change: ±$XXX
[Notes]
- Positions within ±5% of target weight are within tolerance and need no action.
- Sell orders on positions with unrealised gains may trigger tax events (US investors).
- Review lot sizes for HK/A-share stocks before placing orders.
⚠️ 仅供参考,不构成投资建议,请自行决策下单。/ 僅供參考,不構成投資建議,請自行決策下單。/ For reference only. Not investment advice. Place orders at your own discretion.| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. |
stderr | 请运行 | 請運行 | Run |
| No target weights provided | 请告知目标配置,例如:AAPL 30%、TSLA 20%、现金 50% | 請告知目標配置,例如:AAPL 30%、TSLA 20%、現金 50% | Please provide target weights, e.g. AAPL 30%, TSLA 20%, cash 50%. |
| Quote unavailable for a symbol | 跳过该标的,标注价格数据缺失 | 略過該標的,標注價格數據缺失 | Skip that symbol; note price data is unavailable. |
longbridge| MCP tool | CLI equivalent |
|---|---|
| |
| |
| |
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcpquotetrade_readlongbridge-portfolio-diagnosislongbridge-asset-allocationlongbridge-risk-analysislongbridge-portfolio-rebalance/
└── SKILL.md # prompt-only, read-only — no order placement