Loading...
Loading...
Tax-loss harvesting via Longbridge — identify unrealised-loss positions in the account, evaluate tax benefit of realising losses, suggest substitute securities to maintain market exposure (avoiding wash-sale rules), and track the 30-day wash-sale window. Suited for year-end US tax planning. Triggers: "税损收割", "亏损锁定", "wash sale", "税务规划", "节税", "税务优化", "年末税务", "未实现亏损", "稅損收割", "虧損鎖定", "稅務規劃", "節稅", "年末稅務", "未實現虧損", "tax loss harvesting", "wash sale", "tax planning", "realized loss", "unrealized loss", "tax optimization", "year-end tax", "substitute securities".
npx skill4agent add longbridge/skills longbridge-tax-harvestingResponse language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
longbridge auth loginlongbridge <subcommand> --help# Positions with cost basis
longbridge positions --format json
# Current prices (run concurrently for each symbol)
longbridge quote <SYMBOL> --format json| Quantity | Method |
|---|---|
| Unrealised loss | (Current price − Average cost) × Quantity |
| Tax saving estimate | |
| Holding period | Today − position open date (if available); classify short-term (<1yr) or long-term (≥1yr) |
| Wash-sale window | 30 days before + 30 days after the sale date |
| Original | Example substitute (same sector, different issuer) |
|---|---|
| AAPL (tech) | MSFT, GOOGL, or a tech ETF like QQQ |
| SPY (S&P 500 ETF) | IVV or VOO (different fund family) |
| XOM (energy) | CVX, SLB, or XLE ETF |
| Individual stock | Sector ETF covering the same industry |
Tax-Loss Harvesting Analysis — Source: Longbridge Securities
Date: <today> Account: US Securities
[Positions with Unrealised Losses]
Symbol Cost Basis Current Price Unreal. Loss Hold Period Tax Saving Est.
TSLA.US $280.00 $210.00 −$7,000 8 months ~$2,590 (37% rate)
XOM.US $120.00 $108.00 −$1,200 14 months ~$240 (20% rate)
[Harvest Recommendations (ranked by tax saving)]
1. TSLA.US Sell → realise −$7,000 loss → estimated tax saving ~$2,590
Substitute: RIVN.US / LCID.US / DRIV ETF (avoid repurchasing TSLA for 30 days)
⚠️ Wash-sale risk if TSLA was purchased in last 30 days
2. XOM.US Sell → realise −$1,200 loss → estimated tax saving ~$240
Substitute: CVX.US or XLE ETF
[Wash-Sale Warnings]
- Check recent purchase dates; do not repurchase within 30 days of sale.
- Purchasing a call option on the sold stock may also trigger wash-sale.
⚠️ 本分析仅供参考,不构成税务建议。请咨询持牌税务顾问。/ 本分析僅供參考,不構成稅務建議。請諮詢持牌稅務顧問。/ For reference only. Not tax advice. Consult a qualified tax professional.| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到 MCP;若也不可用,请安装 longbridge-terminal | 回退到 MCP;若也不可用,請安裝 longbridge-terminal | Fall back to MCP; if unavailable, install longbridge-terminal. |
stderr | 请运行 | 請運行 | Run |
| No US positions | 账户中无美股持仓,税损收割仅适用于美股 | 賬戶中無美股持倉,稅損收割僅適用於美股 | No US positions found; tax-loss harvesting applies to US stocks only. |
| All positions profitable | 当前所有持仓均为浮盈,无税损收割机会 | 當前所有持倉均為浮盈,無稅損收割機會 | All positions are profitable; no harvesting opportunities. |
| Cost basis unavailable | 无法获取持仓成本,请检查账户权限 | 無法獲取持倉成本,請檢查賬戶權限 | Cannot retrieve cost basis; check account permissions. |
longbridge| MCP tool | CLI equivalent |
|---|---|
| |
| |
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcpquotetrade_readlongbridge-portfolio-diagnosislongbridge-orderslongbridge-fundamentallongbridge-tax-harvesting/
└── SKILL.md # prompt-only, US accounts only, read-only