Portfolio Manager
Overview
Analyze and manage investment portfolios by integrating with Alpaca MCP Server to fetch real-time holdings data, then performing comprehensive analysis covering asset allocation, diversification, risk metrics, individual position evaluation, and rebalancing recommendations. Generate detailed portfolio reports with actionable insights.
This skill leverages Alpaca's brokerage API through MCP (Model Context Protocol) to access live portfolio data, ensuring analysis is based on actual current positions rather than manually entered data.
When to Use
Invoke this skill when the user requests:
- "Analyze my portfolio"
- "Review my current positions"
- "What's my asset allocation?"
- "Check my portfolio risk"
- "Should I rebalance my portfolio?"
- "Evaluate my holdings"
- "Portfolio performance review"
- "What stocks should I buy or sell?"
- Any request involving portfolio-level analysis or management
Prerequisites
Alpaca MCP Server Setup
This skill requires Alpaca MCP Server to be configured and connected. The MCP server provides access to:
- Current portfolio positions
- Account equity and buying power
- Historical positions and transactions
- Market data for held securities
MCP Server Tools Used:
get_account_info - Fetch account equity, buying power, cash balance
get_positions - Retrieve all current positions with quantities, cost basis, market value
get_portfolio_history - Historical portfolio performance data
- Market data tools for price quotes and fundamentals
If Alpaca MCP Server is not connected, inform the user and provide setup instructions from references/alpaca_mcp_setup.md.
Workflow
Step 1: Fetch Portfolio Data via Alpaca MCP
Use Alpaca MCP Server tools to gather current portfolio information:
1.1 Get Account Information:
Use mcp__alpaca__get_account_info to fetch:
- Account equity (total portfolio value)
- Cash balance
- Buying power
- Account status
1.2 Get Current Positions:
Use mcp__alpaca__get_positions to fetch all holdings:
- Symbol ticker
- Quantity held
- Average entry price (cost basis)
- Current market price
- Current market value
- Unrealized P&L ($ and %)
- Position size as % of portfolio
1.3 Get Portfolio History (Optional):
Use mcp__alpaca__get_portfolio_history for performance analysis:
- Historical equity values
- Time-weighted return calculation
- Drawdown analysis
Data Validation:
- Verify all positions have valid ticker symbols
- Confirm market values sum to approximate account equity
- Check for any stale or inactive positions
- Handle edge cases (fractional shares, options, crypto if supported)
Step 2: Enrich Position Data
For each position in the portfolio, gather additional market data and fundamentals:
2.1 Current Market Data:
- Real-time or delayed price quotes
- Daily volume and liquidity metrics
- 52-week range
- Market capitalization
2.2 Fundamental Data:
Use WebSearch or available market data APIs to fetch:
- Sector and industry classification
- Key valuation metrics (P/E, P/B, dividend yield)
- Recent earnings and financial health indicators
- Analyst ratings and price targets
- Recent news and material developments
2.3 Technical Analysis:
- Price trend (20-day, 50-day, 200-day moving averages)
- Relative strength
- Support and resistance levels
- Momentum indicators (RSI, MACD if available)
Step 3: Portfolio-Level Analysis
Perform comprehensive portfolio analysis using frameworks from reference files:
3.1 Asset Allocation Analysis
Read references/asset-allocation.md for allocation frameworks
Analyze current allocation across multiple dimensions:
By Asset Class:
- Equities vs Fixed Income vs Cash vs Alternatives
- Compare to target allocation for user's risk profile
- Assess if allocation matches investment goals
By Sector:
- Technology, Healthcare, Financials, Consumer, etc.
- Identify sector concentration risks
- Compare to benchmark sector weights (e.g., S&P 500)
By Market Cap:
- Large-cap vs Mid-cap vs Small-cap distribution
- Concentration in mega-caps
- Market cap diversification score
By Geography:
- US vs International vs Emerging Markets
- Domestic concentration risk assessment
Output Format:
## Asset Allocation
### Current Allocation vs Target
|-------------|---------|--------|----------|
| US Equities | XX.X% | YY.Y% | +/- Z.Z% |
| ... |
### Sector Breakdown
[Pie chart description or table with sector percentages]
### Top 10 Holdings
|------|--------|----------------|--------|
| 1 | AAPL | X.X% | Technology |
| ... |
3.2 Diversification Analysis
Read references/diversification-principles.md for diversification theory
Evaluate portfolio diversification quality:
Position Concentration:
- Identify top holdings and their aggregate weight
- Flag if any single position exceeds 10-15% of portfolio
- Calculate Herfindahl-Hirschman Index (HHI) for concentration measurement
Sector Concentration:
- Identify dominant sectors
- Flag if any sector exceeds 30-40% of portfolio
- Compare to benchmark sector diversity
Correlation Analysis:
- Estimate correlation between major positions
- Identify highly correlated holdings (potential redundancy)
- Assess true diversification benefit
Number of Positions:
- Optimal range: 15-30 stocks for individual portfolios
- Flag if under-diversified (<10 stocks) or over-diversified (>50 stocks)
Output:
## Diversification Assessment
**Concentration Risk:** [Low / Medium / High]
- Top 5 holdings represent XX% of portfolio
- Largest single position: [SYMBOL] at XX%
**Sector Diversification:** [Excellent / Good / Fair / Poor]
- Dominant sector: [Sector Name] at XX%
- [Assessment of balance across sectors]
**Position Count:** [Optimal / Under-diversified / Over-diversified]
- Total positions: XX stocks
- [Recommendation]
**Correlation Concerns:**
- [List any highly correlated position pairs]
- [Diversification improvement suggestions]
3.3 Risk Analysis
Read references/portfolio-risk-metrics.md for risk measurement frameworks
Calculate and interpret key risk metrics:
Volatility Measures:
- Estimated portfolio beta (weighted average of position betas)
- Individual position volatilities
- Portfolio standard deviation (if historical data available)
Downside Risk:
- Maximum drawdown (from portfolio history)
- Current drawdown from peak
- Positions with significant unrealized losses
Risk Concentration:
- Percentage in high-volatility stocks (beta > 1.5)
- Percentage in speculative/unprofitable companies
- Leverage usage (if applicable)
Tail Risk:
- Exposure to potential black swan events
- Single-stock concentration risk
- Sector-specific event risk
Output:
## Risk Assessment
**Overall Risk Profile:** [Conservative / Moderate / Aggressive]
**Portfolio Beta:** X.XX (vs market at 1.00)
- Interpretation: Portfolio is [more/less] volatile than market
**Maximum Drawdown:** -XX.X% (from $XXX,XXX to $XXX,XXX)
- Current drawdown from peak: -XX.X%
**High-Risk Positions:**
|--------|----------------|------|-------------|
| [TICKER] | XX% | X.XX | [High volatility / Recent loss / etc] |
**Risk Concentrations:**
- XX% in single sector ([Sector])
- XX% in stocks with beta > 1.5
- [Other concentration risks]
**Risk Score:** XX/100 ([Low/Medium/High] risk)
3.4 Performance Analysis
Evaluate portfolio performance using available data:
Absolute Returns:
- Overall portfolio unrealized P&L ($ and %)
- Best performing positions (top 5 by % gain)
- Worst performing positions (bottom 5 by % loss)
Time-Weighted Returns (if history available):
- YTD return
- 1-year, 3-year, 5-year annualized returns
- Compare to benchmark (S&P 500, relevant index)
Position-Level Performance:
- Winners vs Losers ratio
- Average gain on winning positions
- Average loss on losing positions
- Positions near 52-week highs/lows
Output:
## Performance Review
**Total Portfolio Value:** $XXX,XXX
**Total Unrealized P&L:** $XX,XXX (+XX.X%)
**Cash Balance:** $XX,XXX (XX% of portfolio)
**Best Performers:**
|--------|------|----------------|
| [TICKER] | +XX.X% | $XX,XXX |
| ... |
**Worst Performers:**
|--------|------|----------------|
| [TICKER] | -XX.X% | $XX,XXX |
| ... |
**Performance vs Benchmark (if available):**
- Portfolio return: +X.X%