longbridge-profit-analysis

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

longbridge-profit-analysis

longbridge-profit-analysis

Full account P&L analysis — simple return, time-weighted return (TWR), per-symbol attribution, and market-level breakdown — sourced from the user's Longbridge account.
Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
通过用户的Longbridge账户获取全面的账户盈亏分析——包括简单收益率、时间加权收益率(TWR)、单个标的业绩归因、分市场盈亏细分。
响应语言:匹配用户输入语言——简体中文/繁体中文/英文。

When to use

使用场景

  • "我账户今年赚了多少", "我今年的收益率", "account P&L this year"
  • "我的时间加权收益率", "TWR", "time-weighted return"
  • "TSLA 这只股票我亏了多少", "holding P&L for NVDA"
  • "美股账户盈亏", "profit by market", "HK market P&L"
  • "帮我分析一下 Q1 业绩", "Q1 performance analysis"
  • Prefer over
    longbridge-portfolio
    when the user wants return-rate metrics (TWR eliminates cash-flow distortion) or detailed per-symbol attribution.
  • "我账户今年赚了多少", "我今年的收益率", "account P&L this year"
  • "我的时间加权收益率", "TWR", "time-weighted return"
  • "TSLA 这只股票我亏了多少", "holding P&L for NVDA"
  • "美股账户盈亏", "profit by market", "HK market P&L"
  • "帮我分析一下 Q1 业绩", "Q1 performance analysis"
  • 当用户需要收益率指标(TWR可消除现金流干扰)或单个标的详细归因时,优先使用
    longbridge-profit-analysis
    而非
    longbridge-portfolio

Workflow

工作流程

  1. Confirm login; if not logged in, tell user to run
    longbridge auth login
    with Trade scope.
  2. Identify the operation: overall P&L / per-symbol detail / by-market / custom date range.
  3. Extract date range from context if specified; default to YTD if not stated.
  4. Call CLI with
    --format json
    ; run
    --help
    if unsure about flags.
  5. Present: overall return %, absolute gain/loss, TWR (note: eliminates cash-flow timing distortion), top contributors, and breakdown table.
  1. 确认登录状态;若未登录,告知用户运行带有Trade权限的
    longbridge auth login
    命令。
  2. 识别操作类型:整体盈亏分析/单个标的详情/分市场分析/自定义日期范围。
  3. 若上下文指定了日期范围则提取;未指定时默认按年初至今(YTD)统计。
  4. 使用
    --format json
    参数调用CLI;若不确定参数可运行
    --help
    查看。
  5. 展示内容:整体收益率百分比、绝对盈亏额、TWR(注意:消除了现金流时间点干扰)、主要盈亏贡献标的,以及细分表格。

CLI

CLI命令

Run
longbridge profit-analysis --help
to verify exact flags before use.
bash
undefined
使用前请运行
longbridge profit-analysis --help
确认具体参数。
bash
undefined

Overall account P&L with TWR (default: YTD or account lifetime)

带TWR的账户整体盈亏分析(默认:年初至今或账户存续期)

longbridge profit-analysis --format json
longbridge profit-analysis --format json

Custom date range

自定义日期范围

longbridge profit-analysis --start 2026-01-01 --end 2026-04-30 --format json
longbridge profit-analysis --start 2026-01-01 --end 2026-04-30 --format json

Per-symbol P&L detail

单个标的盈亏详情

longbridge profit-analysis detail TSLA.US --format json
longbridge profit-analysis detail TSLA.US --format json

P&L broken down by market

分市场盈亏细分

longbridge profit-analysis by-market --market HK --format json
longbridge profit-analysis by-market --market HK --format json

Check available flags and subcommands

查看可用参数和子命令

longbridge profit-analysis --help
undefined
longbridge profit-analysis --help
undefined

Output

输出内容

Overall P&L

整体盈亏分析

Field简体繁體English
simple_return
简单收益率簡單收益率Simple return
twr
时间加权收益率時間加權收益率Time-weighted return (TWR)
total_profit
总盈亏總盈虧Total P&L
realized
已实现盈亏已實現盈虧Realized P&L
unrealized
未实现盈亏未實現盈虧Unrealized P&L
period
统计期间統計期間Period
TWR note: Always explain TWR briefly — "时间加权收益率消除了追加/取出资金对收益率的影响,是更客观的业绩衡量指标。" / "時間加權收益率消除了追加/取出資金對收益率的影響,是更客觀的業績衡量指標。" / "TWR removes the effect of cash flows (deposits/withdrawals), providing a purer performance measure."
字段简体繁體English
simple_return
简单收益率簡單收益率Simple return
twr
时间加权收益率時間加權收益率Time-weighted return (TWR)
total_profit
总盈亏總盈虧Total P&L
realized
已实现盈亏已實現盈虧Realized P&L
unrealized
未实现盈亏未實現盈虧Unrealized P&L
period
统计期间統計期間Period
TWR说明:需简要解释TWR——"时间加权收益率消除了追加/取出资金对收益率的影响,是更客观的业绩衡量指标。" / "時間加權收益率消除了追加/取出資金對收益率的影響,是更客觀的業績衡量指標。" / "TWR removes the effect of cash flows (deposits/withdrawals), providing a purer performance measure."

Per-symbol detail

单个标的详情

Render: symbol, market, cost basis, current value, unrealized P&L, realized P&L, total return %.
展示:标的代码(symbol)、市场、成本基准、当前价值、未实现盈亏、已实现盈亏、总收益率百分比。

By-market

分市场分析

Render: market (US / HK / CN / SG), total value, P&L, return %.
End every response with:
⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice.
展示:市场(美股/港股/A股/新加坡股市)、总市值、盈亏额、收益率百分比。
每个响应末尾需添加:
⚠️ 以上数据仅供参考,不构成投资建议。/ 以上數據僅供參考,不構成投資建議。/ For reference only. Not investment advice.

Error handling

错误处理

Situation简体繁體English
command not found: longbridge
退回 MCP;如未配置,提示安装 longbridge-terminal退回 MCP;如未設定,提示安裝 longbridge-terminalFall back to MCP; if unavailable, ask user to install longbridge-terminal
not logged in
/
unauthorized
请运行
longbridge auth login
(需要 Trade 权限)
請執行
longbridge auth login
(需要 Trade 權限)
Run
longbridge auth login
with Trade scope
Empty result (no trade history)账户暂无交易记录,无法计算盈亏賬戶暫無交易記錄,無法計算盈虧No trade history found — cannot compute P&L
Invalid date range日期格式须为 YYYY-MM-DD,开始日期须早于结束日期日期格式須為 YYYY-MM-DD,開始日期須早於結束日期Date must be YYYY-MM-DD; start must precede end
Other stderr原文转达,不做静默重试原文轉達,不作靜默重試Relay verbatim; never retry silently
场景简体繁體English
command not found: longbridge
退回MCP;如未配置,提示安装longbridge-terminal退回MCP;如未設定,提示安裝longbridge-terminalFall back to MCP; if unavailable, ask user to install longbridge-terminal
not logged in
/
unauthorized
请运行
longbridge auth login
(需要Trade权限)
請執行
longbridge auth login
(需要Trade權限)
Run
longbridge auth login
with Trade scope
空结果(无交易记录)账户暂无交易记录,无法计算盈亏賬戶暫無交易記錄,無法計算盈虧No trade history found — cannot compute P&L
无效日期范围日期格式须为YYYY-MM-DD,开始日期须早于结束日期日期格式須為YYYY-MM-DD,開始日期須早於結束日期Date must be YYYY-MM-DD; start must precede end
其他错误输出原文转达,不做静默重试原文轉達,不作靜默重試Relay verbatim; never retry silently

MCP fallback

MCP降级方案

If
longbridge
CLI is not installed, use:
CLI usageMCP tool
profit-analysis
mcp__longbridge__profit_analysis
profit-analysis detail <SYMBOL>
mcp__longbridge__profit_analysis_detail
profit-analysis by-market
mcp__longbridge__profit_analysis_by_market
若未安装
longbridge
CLI,可使用:
CLI用法MCP工具
profit-analysis
mcp__longbridge__profit_analysis
profit-analysis detail <SYMBOL>
mcp__longbridge__profit_analysis_detail
profit-analysis by-market
mcp__longbridge__profit_analysis_by_market

Related skills

相关技能

  • Portfolio overview (value, cash share, industry mix) →
    longbridge-portfolio
  • Account holdings snapshot →
    longbridge-positions
  • Order and fill history →
    longbridge-orders
  • Account statements for export →
    longbridge-statement
  • 投资组合概览(市值、现金占比、行业分布)→
    longbridge-portfolio
  • 账户持仓快照 →
    longbridge-positions
  • 订单与成交历史 →
    longbridge-orders
  • 可导出的账户对账单 →
    longbridge-statement

File layout

文件结构

longbridge-profit-analysis/
└── SKILL.md          # prompt-only, no scripts/
longbridge-profit-analysis/
└── SKILL.md          # 仅含提示词,无scripts/目录