GuideOpen

Portfolio Manager (en)

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account. {: .fs-6

Front matter
layout: default
title: "Portfolio Manager"
grand_parent: English
parent: Skill Guides
nav_order: 35
lang_peer: /ja/skills/portfolio-manager/
permalink: /en/skills/portfolio-manager/

Portfolio Manager

{: .no_toc }

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account. {: .fs-6 .fw-300 }

<span class="badge badge-api">Alpaca for full analysis</span>

Download Skill Package (.skill){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } View Source on GitHub{: .btn .fs-5 .mb-4 .mb-md-0 }

<details open markdown="block"> <summary>Table of Contents</summary> {: .text-delta }

  • TOC

{:toc} </details>


Offline holdings workflow

Use [Offline Holdings Review](../workflows.md#portfolio-holdings-review) without credentials to analyze a local CSV or saved Alpaca positions JSON. Navigator recommends this path for CSV and saved-positions source requests. Supply the actual file and aware snapshot timestamp; Navigator does not inspect input. The CLI computes gross holdings weights and per-position unrealized P&L only. See the CSV and shared output contract for the fictional demo, validation and saved-Alpaca adapter. Full account risk, cash, leverage, returns, dividends and trading recommendations are unavailable. Keep personal holdings and generated reports local. Full brokerage analysis requires Alpaca and reconciliation in core-portfolio-weekly.

1. 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.


2. 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

3. 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.


4. Quick Start

# Test Alpaca connection
python3 skills/portfolio-manager/scripts/check_alpaca_connection.py

# Portfolio analysis is done via Claude with Alpaca MCP tools
# See portfolio-manager/references/alpaca-mcp-setup.md for setup

5. 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

A complete saved Alpaca positions list can be converted with skills/portfolio-manager/scripts/normalize_alpaca_positions.py. Supply --positions-json, a verified --account-scope alias, timezone-aware --as-of and --confirm-complete; --output creates a new file in an existing private folder. This local conversion needs no prices, skips no unsupported positions, and preserves exact quantities. Completeness, account attribution and freshness remain operator assertions. Full memory export and workflow enforcement remain manual; see the reconciliation guide below for the input and privacy contract.

Read-only reconciliation before weekly review

For core-portfolio-weekly, prepare complete, same-account broker and ACTIVE / PARTIALLY_CLOSED memory snapshots using the position reconciliation guide. Run skills/portfolio-manager/scripts/reconcile_positions.py locally to obtain JSON and Markdown reports. Stop allocation and rebalance review when can_continue is false or completeness, account attribution or freshness is unresolved. This offline manual gate does not authorize orders or modify theses; automatic exports and replay enforcement remain follow-up work under #493.


6. Resources

References:

  • skills/portfolio-manager/references/alpaca-mcp-setup.md
  • skills/portfolio-manager/references/asset-allocation.md
  • skills/portfolio-manager/references/diversification-principles.md
  • skills/portfolio-manager/references/portfolio-risk-metrics.md
  • skills/portfolio-manager/references/position-evaluation.md
  • skills/portfolio-manager/references/position-reconciliation.md
  • skills/portfolio-manager/references/rebalancing-strategies.md
  • skills/portfolio-manager/references/risk-profile-questionnaire.md
  • skills/portfolio-manager/references/target-allocations.md

Source: https://github.com/tradermonty/claude-trading-skills/blob/main/docs/en/skills/portfolio-manager.md

Author: tradermonty, Trading skills. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.