longbridge-portfolio

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-portfolio

longbridge-portfolio

Prompt-only skill for account-level analysis. Distinguished from
longbridge-positions
(snapshot lookup): this skill answers "how am I doing", not "what do I hold".
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
Privacy: returns the user's private P&L. Only render detailed numbers in direct conversation; if you suspect screen-sharing or third-party observation, ask before showing exact figures. Never echo amounts into PR descriptions, tickets, or other places third parties can read.
纯Prompt技能,用于账户级分析。与
longbridge-positions
(持仓快照查询)的区别在于:本技能回答的是「我的账户表现如何」,而非「我持有哪些资产」。
响应语言:匹配用户输入语言——简体中文 / 繁体中文 / 英文。
隐私说明:返回用户的私人盈亏数据。仅在直接对话中展示详细数字;若怀疑存在屏幕共享或第三方观察,需先询问再显示具体数值。切勿将金额内容同步到PR描述、工单或其他第三方可查看的场所。

Login

登录

This skill requires a logged-in session with trade scope:
bash
longbridge auth login   # check "trade" / 「交易」 permission in the browser auth screen
If using MCP fallback and a tool returns unauthorized / not in authorized scope, re-authorise:
bash
claude mcp logout longbridge
使用本技能需要具备交易权限的登录会话:
bash
longbridge auth login   # 在浏览器授权界面勾选「交易」权限
若使用MCP降级方案且工具返回unauthorized / 未在授权范围内,请重新授权:
bash
claude mcp logout longbridge

Re-trigger any MCP tool call; check "trade" / 「交易」 permission.

重新触发任意MCP工具调用;勾选「交易」权限。

undefined
undefined

When to use

使用场景

  • "我账户表现如何", "how is my account doing?"
  • "我本月浮盈", "this month's P&L"
  • "我哪只股票贡献最多", "top contributors"
  • "我货币暴露", "currency exposure"
  • "我账户行业分布", "industry mix"
  • "我账户表现如何", "how is my account doing?"
  • "我本月浮盈", "this month's P&L"
  • "我哪只股票贡献最多", "top contributors"
  • "我货币暴露", "currency exposure"
  • "我账户行业分布", "industry mix"

"Me" disambiguation

「我」的歧义消除

By default, treat / me / my account as all-account aggregate. If the user explicitly says "我的港股账户" / "my US sub-account", restrict to that sub-account.
默认情况下,将 / me / my account视为全账户汇总。若用户明确提及*"我的港股账户"* / "my US sub-account",则仅针对该子账户进行分析。

Time-window inference

时间窗口推断

PhraseWindow
本月 / this monthfirst day of this month → today
本周 / this weekthis Monday → today
近 30 天 / past 30 days
today-30
today
今年 / YTDJan 1 → today
全部 / since opening / no timeuse
profit_analysis
defaults (typically since account opening)
LLM uses today's date from system context.
表述时间范围
本月 / this month当月第一天 → 今日
本周 / this week本周一 → 今日
近30天 / past 30 days
today-30
today
今年 / YTD1月1日 → 今日
全部 / since opening / 无时间限定使用
profit_analysis
默认设置(通常为账户开立以来)
LLM会从系统上下文获取今日日期。

Tool selection by intent

按意图选择工具

User intentTools
Full portfolio overview
profit_analysis
+
stock_positions
+
account_balance
(combo)
This month's P&L
profit_analysis(start=2026-04-01, end=2026-04-28)
Biggest contributors
profit_analysis_detail
+
stock_positions
Currency exposure
account_balance
+
exchange_rate
Industry distribution
stock_positions
+ per-symbol
static_info
(industry field)
Short-selling margin details
portfolio short-margin
用户意图使用工具
组合全景概览
profit_analysis
+
stock_positions
+
account_balance
(组合使用)
本月盈亏
profit_analysis(start=2026-04-01, end=2026-04-28)
最大贡献个股
profit_analysis_detail
+
stock_positions
货币敞口
account_balance
+
exchange_rate
行业分布
stock_positions
+ 个股
static_info
(行业字段)
卖空保证金详情
portfolio short-margin

CLI

CLI命令

Run
longbridge <subcommand> --help
to verify exact flags. Example for "我本月账户表现" (run concurrently):
bash
longbridge profit-analysis --start 2026-05-01 --end 2026-05-06 --format json
longbridge profit-analysis detail --start 2026-05-01 --end 2026-05-06 --format json
longbridge assets --format json
longbridge positions --format json
longbridge exchange-rate --format json
For short-selling positions:
bash
longbridge portfolio short-margin --format json   # per-position margin deposit breakdown
运行
longbridge <subcommand> --help
查看具体参数。*"我本月账户表现"*的示例(并行运行):
bash
longbridge profit-analysis --start 2026-05-01 --end 2026-05-06 --format json
longbridge profit-analysis detail --start 2026-05-01 --end 2026-05-06 --format json
longbridge assets --format json
longbridge positions --format json
longbridge exchange-rate --format json
针对卖空持仓:
bash
longbridge portfolio short-margin --format json   # 逐持仓保证金明细

Workflow

工作流程

  1. Confirm trade-scope login (see Login section).
  2. Decide the time window (table above) and the toolset (table above).
  3. Run CLI commands concurrently (see CLI section). If
    longbridge
    is not installed, fall back to MCP.
  4. Convert FX to USD-equivalent yourself (use
    exchange_rate
    from the same call day) —
    profit_analysis
    may return mixed currencies.
  5. Render the 4-section structure. Cite Longbridge Securities. End with the not-investment-advice disclaimer.
  1. 确认已登录且具备交易权限(见登录部分)。
  2. 确定时间窗口(见上表)和工具组合(见上表)。
  3. 并行运行CLI命令(见CLI部分)。若未安装
    longbridge
    ,则降级使用MCP。
  4. 自行转换汇率为美元等值金额(使用当日调用的
    exchange_rate
    数据)——
    profit_analysis
    可能返回多种货币的数据。
  5. 生成4部分结构的报告。注明数据来源为Longbridge Securities。结尾附上非投资建议的免责声明。

Output template

输出模板

My account performance — Source: Longbridge Securities; period YYYY-MM-DD ~ YYYY-MM-DD

[1. Overview]
- Total NAV (USD-equivalent): $X
- Cash: $X (Y% of NAV)
- Holdings: $X (Y% of NAV)
- Period P&L: +$X (+Y%)

[2. Currency exposure]
- USD: $X
- HKD: HK$X (≈ $X USD)
- CNY: ¥X (≈ $X USD)
- SGD: S$X (if held)

[3. Single-stock contribution (this period)]
| Symbol | Name | P&L (USD-eq) | Share |
|---|---|---:|---:|
| NVDA.US | NVIDIA | +$5,200 | 42% |
| 700.HK  | 腾讯  | +$3,100 | 25% |
| TSLA.US | Tesla | -$1,800 | -15% |
| ...     | ...   | ...     | ... |

[4. Industry distribution] (stock_positions × static_info industry field, by market value)
- 半导体 / Semiconductors: 35%
- 互联网 / Internet:        20%
- ...

⚠️ 以上数据仅供参考,不构成调仓建议。/ 以上數據僅供參考,不構成調倉建議。/ For reference only. Not rebalancing advice.
(Translate into the user's language.)
我的账户表现 — 来源:Longbridge Securities;时段 YYYY-MM-DD ~ YYYY-MM-DD

[1. 概览]
- 总净值(美元等值):$X
- 现金:$X(占净值Y%)
- 持仓:$X(占净值Y%)
- 时段盈亏:+$X(+Y%)

[2. 货币敞口]
- 美元:$X
- 港币:HK$X(≈ $X 美元)
- 人民币:¥X(≈ $X 美元)
- 新加坡元:S$X(若持有)

[3. 个股贡献(本时段)]
| 代码 | 名称 | 盈亏(美元等值) | 占比 |
|---|---|---:|---:|
| NVDA.US | NVIDIA | +$5,200 | 42% |
| 700.HK  | 腾讯  | +$3,100 | 25% |
| TSLA.US | Tesla | -$1,800 | -15% |
| ...     | ...   | ...     | ... |

[4. 行业分布](基于stock_positions × static_info行业字段,按市值计算)
- 半导体 / Semiconductors: 35%
- 互联网 / Internet:        20%
- ...

⚠️ 以上数据仅供参考,不构成调仓建议。/ 以上數據僅供參考,不構成調倉建議。/ For reference only. Not rebalancing advice.
(需翻译为用户使用的语言。)

Performance optimisation

性能优化

Industry distribution requires
static_info
per symbol (N positions = N calls). When a user holds ≥ 30 names:
  • Tell the user "computing industry distribution; this may take a moment...", OR
  • Simplify: take the top 10 by market value, group the rest as "other".
Same for the contribution ranking — list the top 10 (mix of leaders and laggards) by default; do not flood with the full position book.
计算行业分布需要调用每个标的的
static_info
(N个持仓 = N次调用)。当用户持有**≥30个标的**时:
  • 告知用户*"正在计算行业分布,可能需要片刻时间..."*,或者
  • 简化处理:取市值前10的标的,其余归为*"其他"*类别。
个股贡献排名同理——默认列出前10名(包含盈利最多和亏损最多的标的);无需展示全部持仓。

Output constraints

输出约束

  • Must include all 4 sections.
  • Must label currency on every figure; mark USD-equivalent with
    .
  • Must end with the not-rebalancing-advice disclaimer.
  • 必须包含全部4个部分。
  • 必须为每个数值标注货币类型;美元等值金额需用
    标记。
  • 必须以非调仓建议的免责声明结尾。

Error handling

错误处理

SituationReply
command not found: longbridge
Fall back to MCP; if MCP also unavailable, tell user to install longbridge-terminal.
stderr
not logged in
/
unauthorized
Tell user to run
longbridge auth login
with trade permission.
profit-analysis
returns empty
"{window}: no recorded P&L (account had no positions or no trades)."
assets
returns one currency
Skip the multi-currency section; show that one currency.
positions
returns empty
Skip sections 3 + 4; show cash-only overview.
场景回复内容
command not found: longbridge
降级使用MCP;若MCP也不可用,告知用户安装longbridge-terminal。
标准错误输出
not logged in
/
unauthorized
告知用户运行
longbridge auth login
并勾选交易权限。
profit-analysis
返回空数据
"{window}: 无记录的盈亏数据(账户无持仓或无交易)。"
assets
仅返回一种货币
跳过多货币部分,仅展示该种货币。
positions
返回空数据
跳过第3和第4部分,仅展示现金概览。

MCP fallback

MCP降级方案

If
longbridge
CLI is not installed (
command not found
), use MCP tools instead:
MCP toolCLI equivalentScope
mcp__longbridge__profit_analysis
longbridge profit-analysis
trade
mcp__longbridge__profit_analysis_detail
longbridge profit-analysis detail
trade
mcp__longbridge__stock_positions
longbridge positions
trade
mcp__longbridge__account_balance
longbridge assets
trade
mcp__longbridge__fund_positions
longbridge fund-positions
trade
mcp__longbridge__exchange_rate
longbridge exchange-rate
quote
mcp__longbridge__static_info
longbridge static
quote
MCP setup:
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp
(trade scope required).
若未安装
longbridge
CLI(提示
command not found
),则使用MCP工具替代:
MCP工具对应CLI命令权限范围
mcp__longbridge__profit_analysis
longbridge profit-analysis
交易
mcp__longbridge__profit_analysis_detail
longbridge profit-analysis detail
交易
mcp__longbridge__stock_positions
longbridge positions
交易
mcp__longbridge__account_balance
longbridge assets
交易
mcp__longbridge__fund_positions
longbridge fund-positions
交易
mcp__longbridge__exchange_rate
longbridge exchange-rate
行情
mcp__longbridge__static_info
longbridge static
行情
MCP配置:
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp
(需交易权限)。

Related skills

相关技能

  • Position lookup ("what do I own?") →
    longbridge-positions
  • Per-symbol drill-down →
    longbridge-quote
    ,
    longbridge-valuation
    ,
    longbridge-fundamental
  • "Why is X down?"
    longbridge-news
  • "Should I sell X?" → combine with
    longbridge-valuation
    +
    longbridge-fundamental
    for a fuller picture.
  • 持仓查询(「我持有什么?」)→
    longbridge-positions
  • 个股深度分析 →
    longbridge-quote
    ,
    longbridge-valuation
    ,
    longbridge-fundamental
  • "为什么X下跌?"
    longbridge-news
  • "我应该卖出X吗?" → 结合
    longbridge-valuation
    +
    longbridge-fundamental
    获取更全面的分析。

File layout

文件结构

longbridge-portfolio/
└── SKILL.md          # prompt-only, no scripts/
longbridge-portfolio/
└── SKILL.md          # 纯Prompt技能,无scripts目录/
```",