mcpField
S
stock-portfolio

stock-portfolio

github.com/nickbuddy2046Other096 installsUpdated 5w ago
Repository

About stock-portfolio

stock-portfolio is a Longbridge skill for account data, order management, and portfolio analysis. It covers holdings, cash flows, performance, and risk frameworks, with explicit confirmation requirements for order and recurring-investment changes.

Key features

  1. 01Assets, balances, and cash flows
  2. 02Stock and fund position lookup
  3. 03Order and recurring investment management
  4. 04Portfolio diagnosis and rebalancing
  5. 05Risk, performance, and tax analysis

Use cases

  1. 01Review account holdings and profit or loss
  2. 02Export statements or inspect cash flows
  3. 03Preview and manage orders or DCA plans
  4. 04Assess portfolio risk and allocation

MCP support

If the CLI is unavailable, the skill recommends using MCP server tools and discovering available tools at runtime.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/nickbuddy2046/stock-skills --skill stock-portfolio

After installing, type/stock-portfolioin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
asset-allocation.md
assets.md
bank-cards.md
cash-flow.md
dca.md
fund-positions.md
margin-ratio.md
max-qty.md
order.md
performance-attribution.md
portfolio-diagnosis.md
portfolio-rebalance.md
portfolio.md
positions.md
profit-analysis.md
risk-analysis.md
risk-return.md
statement.md
tax-harvesting.md

Details

From the project README

Longbridge Portfolio & Orders

Account data, order management, and portfolio analysis frameworks via the stock data provider.

Response language: match the user's input language — Simplified Chinese / Traditional Chinese / English.

Data-source policy: recommend only stock data and platform capabilities.

When to use

Trigger when user asks about: account assets / net value, stock or fund positions, P&L / floating gain/loss, cash flow records, account statements, margin requirements, maximum buy quantity, placing / cancelling / modifying orders, DCA recurring investment status, portfolio diagnosis, rebalancing plan, asset allocation, risk analysis, performance attribution, or tax-loss harvesting.

Sub-topic Routing

User intentLoad references file
Account total assets / net valuereferences/assets.md
Cash flow / deposits / withdrawalsreferences/cash-flow.md
Portfolio overview / P&L curvereferences/portfolio.md
Stock positionsreferences/positions.md
Fund positionsreferences/fund-positions.md
Margin ratio requirementsreferences/margin-ratio.md
Max buy/sell quantityreferences/max-qty.md
P&L analysisreferences/profit-analysis.md
Account statement exportreferences/statement.md
Bank cardsreferences/bank-cards.md
Order management (buy/sell/cancel)references/order.md
DCA recurring investmentreferences/dca.md
Portfolio diagnosisreferences/portfolio-diagnosis.md
Rebalancing planreferences/portfolio-rebalance.md
Asset allocationreferences/asset-allocation.md
Risk analysis (VaR/CVaR)references/risk-analysis.md
Risk-return optimizationreferences/risk-return.md
Performance attribution (Brinson)references/performance-attribution.md
Tax-loss harvestingreferences/tax-harvesting.md

CLI Commands

Run longbridge <cmd> --help for current flags and output fields.

assets — account net assets, cash, buying power, margin breakdown
cash-flow — cash flow records (deposits, withdrawals, dividends)
portfolio — total assets, P&L, holdings, intraday P&L
positions — current stock positions across all sub-accounts 🔐
fund-positions — current fund positions across all sub-accounts 🔐
margin-ratio — margin ratio requirements for a symbol
max-qty — estimated max buy or sell quantity
profit-analysis — profit and loss analysis
statement — download and export account statements (daily/monthly)
bank-cards — list bank cards for the current account
withdrawals — withdrawal history 🔐
deposits — deposit history 🔐
order — list, detail, buy, sell, cancel, replace orders 🔐 ⚠️ mutating
dca — recurring investment: list, create, pause, resume, cancel 🔐 ⚠️ mutating

Auth requirements

  • margin-ratio, max-qty: Public — no login required
  • assets, cash-flow, portfolio, profit-analysis: 🔐 Requires Quote permission
  • positions, fund-positions, statement, bank-cards, withdrawals, deposits: 🔐 Requires Trade permission
  • order, dca (mutating operations): 🔐 Requires Trade permission — always present a preview before executing, wait for explicit confirmation

Frameworks

Portfolio Diagnosis

Concentration risk, sector distribution, factor exposure, correlation risk. See references/portfolio-diagnosis.md.

Portfolio Rebalancing

Weight drift analysis, rebalance trade list, transaction cost and tax impact. See references/portfolio-rebalance.md.

Asset Allocation

MPT efficient frontier, Black-Litterman, risk parity, all-weather strategy. See references/asset-allocation.md.

Risk Analysis

VaR (historical/parametric), CVaR, max drawdown, Sharpe/Calmar, historical scenario stress tests. See references/risk-analysis.md.

Risk-Return Optimization

Risk-adjusted return-optimal portfolios by risk preference and horizon. See references/risk-return.md.

Performance Attribution (Brinson)

Allocation/selection/interaction effects, factor alpha/beta, timing ability (T-M model). See references/performance-attribution.md.

Tax-Loss Harvesting

Identify unrealised losses, suggest substitutes, track 30-day wash-sale window. See references/tax-harvesting.md.

Error handling

SituationResponse
command not found: longbridgeInstall longbridge-terminal
not logged in / unauthorizedRun longbridge auth login; tick Trade permission
order / dca mutationAlways preview plan first; wait for user confirmation before executing

MCP fallback

Use MCP server if CLI unavailable. Discover tools at runtime.

Related skills

User wantsUse
Real-time market quotesstock-market-data
Fundamental analysisstock-fundamentals
Watchlist managementstock-watchlist
Institutional shareholders / fund holders (not my account)stock-research
IPO subscription ordersstock-market-data (ipo command)

File layout

longbridge-portfolio/
├── SKILL.md
└── references/
    ├── assets.md · cash-flow.md · portfolio.md · positions.md · fund-positions.md
    ├── margin-ratio.md · max-qty.md · profit-analysis.md · statement.md · bank-cards.md
    ├── order.md · dca.md
    └── portfolio-diagnosis.md · portfolio-rebalance.md · asset-allocation.md
        risk-analysis.md · risk-return.md · performance-attribution.md · tax-harvesting.md

Comments

Markdown supported