Skill: veeramanikandanr48/portfolio-manager (version 0.1.0)

--- name: portfolio-manager description: 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. --- # 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:** ```markdown ## Asset Allocation ### Current Allocation vs Target | Asset Class | Current | Target | Variance | |-------------|---------|--------|----------| | US Equities | XX.X% | YY.Y% | +/- Z.Z% | | ... | ### Sector Breakdown [Pie chart description or table with sector percentages] ### Top 10 Holdings | Rank | Symbol | % of Portfolio | Sector | |------|--------|----------------|--------| | 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:** ```markdown ## 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:** ```markdown ## 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:** | Symbol | % of Portfolio | Beta | Risk Factor | |--------|----------------|------|-------------| | [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:** ```markdown ## Performance Review **Total Portfolio Value:** $XXX,XXX **Total Unrealized P&L:** $XX,XXX (+XX.X%) **Cash Balance:** $XX,XXX (XX% of portfolio) **Best Performers:** | Symbol | Gain | Position Value | |--------|------|----------------| | [TICKER] | +XX.X% | $XX,XXX | | ... | **Worst Performers:** | Symbol | Loss | Position Value | |--------|------|----------------| | [TICKER] | -XX.X% | $XX,XXX | | ... | **Performance vs Benchmark (if available):** - Portfolio return: +X.X% - S&P 500 return: +Y.Y% - Alpha: +/- Z.Z% ``` ### Step 4: Individual Position Analysis For key positions (top 10-15 by portfolio weight), perform detailed analysis: **Read references/position-evaluation.md** for position analysis framework For each significant position: **4.1 Current Thesis Validation:** - Why was this position initiated? (if known from user context) - Has the investment thesis played out or broken? - Recent company developments and news **4.2 Valuation Assessment:** - Current valuation metrics (P/E, P/B, etc.) - Compare to historical valuation range - Compare to sector peers - Overvalued / Fair / Undervalued assessment **4.3 Technical Health:** - Price trend (uptrend, downtrend, sideways) - Position relative to moving averages - Support and resistance levels - Momentum status **4.4 Position Sizing:** - Current weight in portfolio - Is size appropriate given conviction and risk? - Overweight or underweight vs optimal **4.5 Action Recommendation:** - **HOLD** - Position is well-sized and thesis intact - **ADD** - Underweight given opportunity, thesis strengthening - **TRIM** - Overweight or valuation stretched - **SELL** - Thesis broken, better opportunities elsewhere **Output per position:** ```markdown ### [SYMBOL] - [Company Name] (XX.X% of portfolio) **Position Details:** - Shares: XXX - Avg Cost: $XX.XX - Current Price: $XX.XX - Market Value: $XX,XXX - Unrealized P/L: $X,XXX (+XX.X%) **Fundamental Snapshot:** - Sector: [Sector] - Market Cap: $XX.XB - P/E: XX.X | Dividend Yield: X.X% - Recent developments: [Key news or earnings] **Technical Status:** - Trend: [Uptrend / Downtrend / Sideways] - Price vs 50-day MA: [Above/Below by XX%] - Support: $XX.XX | Resistance: $XX.XX **Position Assessment:** - **Thesis Status:** [Intact / Weakening / Broken / Strengthening] - **Valuation:** [Undervalued / Fair / Overvalued] - **Position Sizing:** [Optimal / Overweight / Underweight] **Recommendation:** [HOLD / ADD / TRIM / SELL] **Rationale:** [1-2 sentence explanation] ``` ### Step 5: Rebalancing Recommendations **Read references/rebalancing-strategies.md** for rebalancing approaches Generate specific rebalancing recommendations: **5.1 Identify Rebalancing Triggers:** - Positions that have drifted significantly from target weights - Sector/asset class allocations requiring adjustment - Overweight positions to trim (exceeded threshold) - Underweight areas to add (below threshold) - Tax considerations (capital gains implications) **5.2 Develop Rebalancing Plan:** **Positions to TRIM:** - Overweight positions (>threshold deviation from target) - Stocks that have run up significantly (valuation concerns) - Concentrated positions exceeding 15-20% of portfolio - Positions with broken thesis **Positions to ADD:** - Underweight sectors or asset classes - High-conviction positions currently underweight - New opportunities to improve diversification **Cash Deployment:** - If excess cash (>10% of portfolio), suggest deployment - Prioritize based on opportunity and allocation gaps **5.3 Prioritization:** Rank rebalancing actions by priority: 1. **Immediate** - Risk reduction (trim concentrated positions) 2. **High Priority** - Major allocation drift (>10% from target) 3. **Medium Priority** - Moderate drift (5-10% from target) 4. **Low Priority** - Fine-tuning and opportunistic adjustments **Output:** ```markdown ## Rebalancing Recommendations ### Summary - **Rebalancing Needed:** [Yes / No / Optional] - **Primary Reason:** [Concentration risk / Sector drift / Cash deployment / etc] - **Estimated Trades:** X sell orders, Y buy orders ### Recommended Actions #### HIGH PRIORITY: Risk Reduction **TRIM [SYMBOL]** from XX% to YY% of portfolio - **Shares to Sell:** XX shares (~$XX,XXX) - **Rationale:** [Overweight / Valuation extended / etc] - **Tax Impact:** $X,XXX capital gain (est) #### MEDIUM PRIORITY: Asset Allocation **ADD [Sector/Asset Class]** exposure - **Target:** Increase from XX% to YY% - **Suggested Stocks:** [SYMBOL1, SYMBOL2, SYMBOL3] - **Amount to Invest:** ~$XX,XXX #### CASH DEPLOYMENT **Current Cash:** $XX,XXX (XX% of portfolio) - **Recommendation:** [Deploy / Keep for opportunities / Reduce to X%] - **Suggested Allocation:** [Distribution across sectors/stocks] ### Implementation Plan 1. [First action - highest priority] 2. [Second action] 3. [Third action] ... **Timing Considerations:** - [Tax year-end planning / Earnings season / Market conditions] - [Suggested phasing if applicable] ``` ### Step 6: Generate Portfolio Report Create comprehensive markdown report saved to repository root: **Filename:** `portfolio_analysis_YYYY-MM-DD.md` **Report Structure:** ```markdown # Portfolio Analysis Report **Account:** [Account type if available] **Report Date:** YYYY-MM-DD **Portfolio Value:** $XXX,XXX **Total P&L:** $XX,XXX (+XX.X%) --- ## Executive Summary [3-5 bullet points summarizing key findings] - Overall portfolio health assessment - Major strengths - Key risks or concerns - Primary recommendations --- ## Holdings Overview [Summary table of all positions] --- ## Asset Allocation [Section from Step 3.1] --- ## Diversification Analysis [Section from Step 3.2] --- ## Risk Assessment [Section from Step 3.3] --- ## Performance Review [Section from Step 3.4] --- ## Position Analysis [Detailed analysis of top 10-15 positions from Step 4] --- ## Rebalancing Recommendations [Section from Step 5] --- ## Action Items **Immediate Actions:** - [ ] [Action 1] - [ ] [Action 2] **Medium-Term Actions:** - [ ] [Action 3] - [ ] [Action 4] **Monitoring Priorities:** - [ ] [Watch list item 1] - [ ] [Watch list item 2] --- ## Appendix: Full Holdings [Complete table with all positions and metrics] ``` ### Step 7: Interactive Follow-up Be prepared to answer follow-up questions: **Common Questions:** **"Why should I sell [SYMBOL]?"** - Explain specific concerns (valuation, thesis breakdown, concentration) - Provide supporting data - Offer alternative positions if applicable **"What should I buy instead?"** - Suggest specific stocks to improve allocation - Explain how they address portfolio gaps - Provide brief investment thesis **"What's my biggest risk?"** - Identify primary risk factor (concentration, sector exposure, volatility) - Quantify the risk - Suggest mitigation strategies **"How does my portfolio compare to [benchmark]?"** - Compare allocation, sector weights, risk metrics - Highlight key differences - Assess if differences are justified **"Should I rebalance now or wait?"** - Consider market conditions, tax implications, transaction costs - Provide timing recommendation with rationale **"Can you analyze [specific position] in more detail?"** - Perform deep-dive analysis using us-stock-analysis skill if needed - Integrate findings back into portfolio context ## Analysis Frameworks ### Target Allocation Templates This skill includes reference allocation models for different investor profiles: **Read references/target-allocations.md** for detailed models: - **Conservative** (Capital preservation, income focus) - **Moderate** (Balanced growth and income) - **Growth** (Long-term capital appreciation) - **Aggressive** (Maximum growth, high risk tolerance) Each model includes: - Asset class targets (Stocks/Bonds/Cash/Alternatives) - Sector guidelines - Market cap distribution - Geographic allocation - Position sizing rules Use these as comparison benchmarks when user hasn't specified their allocation strategy. ### Risk Profile Assessment If user's target allocation is unknown, assess appropriate risk profile based on: - Age (if mentioned) - Investment timeline (if mentioned) - Current allocation (reveals preferences) - Position types (conservative vs speculative stocks) **Read references/risk-profile-questionnaire.md** for assessment framework ## Output Guidelines **Tone and Style:** - Objective and analytical - Actionable recommendations with clear rationale - Acknowledge uncertainty in market forecasts - Balance optimism with risk awareness - Quantify whenever possible **Data Presentation:** - Tables for comparisons and metrics - Percentages for allocations and returns - Dollar amounts for absolute values - Consistent formatting throughout report **Recommendation Clarity:** - Explicit action verbs (TRIM, ADD, HOLD, SELL) - Specific quantities (sell XX shares, add $X,XXX) - Priority levels (Immediate, High, Medium, Low) - Supporting rationale for each recommendation **Visual Descriptions:** - Describe allocation breakdowns as if creating pie charts - Sector weights as bar chart equivalents - Performance trends with directional indicators (↑ ↓ →) ## Reference Files Load these references as needed during analysis: **references/alpaca-mcp-setup.md** - When: User needs help setting up Alpaca MCP Server - Contains: Installation instructions, API key configuration, MCP server connection steps, troubleshooting **references/asset-allocation.md** - When: Analyzing portfolio allocation or creating rebalancing plan - Contains: Asset allocation theory, optimal allocation by risk profile, sector allocation guidelines, rebalancing triggers **references/diversification-principles.md** - When: Assessing portfolio diversification quality - Contains: Modern portfolio theory basics, correlation concepts, optimal position count, concentration risk thresholds, diversification metrics **references/portfolio-risk-metrics.md** - When: Calculating risk scores or interpreting volatility - Contains: Beta calculation, standard deviation, Sharpe ratio, maximum drawdown, Value at Risk (VaR), risk-adjusted return metrics **references/position-evaluation.md** - When: Analyzing individual holdings for buy/hold/sell decisions - Contains: Position analysis framework, thesis validation checklist, position sizing guidelines, sell discipline criteria **references/rebalancing-strategies.md** - When: Developing rebalancing recommendations - Contains: Rebalancing methodologies (calendar-based, threshold-based, tactical), tax optimization strategies, transaction cost considerations, implementation timing **references/target-allocations.md** - When: Need benchmark allocations for comparison - Contains: Model portfolios for conservative/moderate/growth/aggressive investors, sector target ranges, market cap distributions **references/risk-profile-questionnaire.md** - When: User hasn't specified risk tolerance or target allocation - Contains: Risk assessment questions, scoring methodology, risk profile classification ## Error Handling **If Alpaca MCP Server is not connected:** 1. Inform user that Alpaca integration is required 2. Provide setup instructions from references/alpaca-mcp-setup.md 3. Offer alternative: manual data entry (less ideal, user provides CSV of positions) **If API returns incomplete data:** - Proceed with available data - Note limitations in report - Suggest manual verification for missing positions **If position data seems stale:** - Flag the issue - Recommend refreshing connection or checking Alpaca status - Proceed with analysis but caveat findings **If user has no positions:** - Acknowledge empty portfolio - Offer portfolio construction guidance instead of analysis - Suggest using value-dividend-screener or us-stock-analysis for stock ideas ## Advanced Features ### Tax-Loss Harvesting Opportunities Identify positions with unrealized losses suitable for tax-loss harvesting: - Positions with losses >5% - Holding period considerations (avoid wash sale rule) - Replacement security suggestions (similar but not substantially identical) ### Dividend Income Analysis For portfolios with dividend-paying stocks: - Estimate annual dividend income - Dividend growth rate trajectory - Dividend coverage and sustainability - Yield on cost for long-term holdings ### Correlation Matrix For portfolios with 5-20 positions: - Estimate correlation between major positions - Identify redundant positions (correlation >0.8) - Suggest diversification improvements ### Scenario Analysis Model portfolio behavior under different scenarios: - **Bull Market** (+20% equity appreciation) - **Bear Market** (-20% equity decline) - **Sector Rotation** (Tech weakness, Value strength) - **Rising Rates** (Impact on growth stocks and bonds) ## Example Queries **Basic Portfolio Review:** - "Analyze my portfolio" - "Review my positions" - "How's my portfolio doing?" **Allocation Analysis:** - "What's my asset allocation?" - "Am I too concentrated in tech?" - "Show me my sector breakdown" **Risk Assessment:** - "Is my portfolio too risky?" - "What's my portfolio beta?" - "What are my biggest risks?" **Rebalancing:** - "Should I rebalance?" - "What should I buy or sell?" - "How can I improve diversification?" **Performance:** - "What are my best and worst positions?" - "How am I performing vs the market?" - "Which stocks are winning and losing?" **Position-Specific:** - "Should I sell [SYMBOL]?" - "Is [SYMBOL] overweight in my portfolio?" - "What should I do with [SYMBOL]?" ## Limitations and Disclaimers **Include in all reports:** *This analysis is for informational purposes only and does not constitute financial advice. Investment decisions should be made based on individual circumstances, risk tolerance, and financial goals. Past performance does not guarantee future results. Consult with a qualified financial advisor before making investment decisions.* *Data accuracy depends on Alpaca API and third-party market data sources. Verify critical information independently. Tax implications are estimates only; consult a tax professional for specific guidance.*

path: README.md
content: # Portfolio Manager

Comprehensive portfolio analysis and management skill that integrates with Alpaca MCP Server to fetch real-time holdings data and generate detailed portfolio reports with rebalancing recommendations.

## Overview

Portfolio Manager analyzes your investment portfolio across multiple dimensions:

- **Asset Allocation** - Stocks, bonds, cash distribution vs target allocation
- **Diversification** - Sector breakdown, position concentration, correlation analysis
- **Risk Assessment** - Portfolio beta, volatility, maximum drawdown, risk score
- **Performance Review** - Winners/losers, absolute and relative returns, benchmarking
- **Position Analysis** - Detailed evaluation of individual holdings (HOLD/ADD/TRIM/SELL recommendations)
- **Rebalancing Plan** - Specific actions to optimize portfolio allocation

## Features

✅ **Alpaca Integration** - Automatically fetches positions via Alpaca MCP Server
✅ **Multi-Dimensional Analysis** - Asset class, sector, geography, market cap, style
✅ **Risk Metrics** - Beta, volatility, drawdown, concentration, HHI
✅ **Position Evaluation** - Thesis validation, valuation, sizing, relative opportunity
✅ **Rebalancing Recommendations** - Prioritized actions (TRIM/ADD/HOLD/SELL)
✅ **Comprehensive Reports** - Markdown reports saved to repository
✅ **Model Portfolios** - Compare to Conservative/Moderate/Growth/Aggressive benchmarks

## Prerequisites

### Required: Alpaca Account and MCP Server

This skill requires:

1. **Alpaca Brokerage Account** (paper or live)
   - Sign up: https://alpaca.markets/
   - Paper trading account (free, simulated money) recommended for testing

2. **Alpaca MCP Server** configured in Claude
   - Provides access to portfolio positions via MCP tools
   - Setup guide: `references/alpaca-mcp-setup.md`

3. **API Credentials** (API Key ID and Secret Key)
   - Generate in Alpaca dashboard
   - Set environment variables:
     ```bash
     export ALPACA_API_KEY="your_api_key_id"
     export ALPACA_SECRET_KEY="your_secret_key"
     export ALPACA_PAPER="true"  # or "false" for live trading
     ```

### Optional: Manual Data Entry

If Alpaca MCP Server is unavailable, you can provide portfolio data manually via CSV:

```csv
symbol,quantity,cost_basis,current_price
AAPL,100,150.00,175.50
MSFT,50,280.00,310.25
```

## Installation

### For Claude Desktop/Code Users

1. **Copy skill to Claude Skills directory:**
   ```bash
   cp -r portfolio-manager ~/.claude/skills/
   ```

2. **Restart Claude** to detect the skill

3. **Configure Alpaca credentials** (see Prerequisites)

### For Claude Web App Users

1. **Download ZIP package:**
   - `zip-packages/portfolio-manager.zip`

2. **Upload to Claude:**
   - Click "+" in Claude web interface
   - Select "Upload Skill"
   - Choose `portfolio-manager.zip`

3. **Note:** Alpaca MCP Server may not be available in web version; use manual CSV data entry

## Usage

### Basic Portfolio Analysis

Simply ask Claude to analyze your portfolio:

```
"Analyze my portfolio"
"Review my current positions"
"How's my portfolio doing?"
```

The skill will:
1. Fetch positions from Alpaca via MCP
2. Enrich data with market information
3. Perform comprehensive analysis
4. Generate detailed report
5. Provide rebalancing recommendations

### Specific Analysis Types

**Asset Allocation Check:**
```
"What's my current asset allocation?"
"Am I properly diversified?"
```

**Risk Assessment:**
```
"How risky is my portfolio?"
"What's my portfolio beta?"
"What are my biggest risks?"
```

**Rebalancing:**
```
"Should I rebalance my portfolio?"
"What should I buy or sell?"
"Is anything too concentrated?"
```

**Position Review:**
```
"Should I sell Tesla?"
"Is Apple overweight in my portfolio?"
"What should I do with my tech stocks?"
```

**Performance:**
```
"What are my best performing stocks?"
"Which positions are losing money?"
"How am I doing vs the S&P 500?"
```

## Analysis Output

Portfolio Manager generates a comprehensive markdown report including:

### 1. Executive Summary
- Overall portfolio health
- Key strengths and concerns
- Primary recommendations

### 2. Holdings Overview
- All positions with quantities, values, P/L

### 3. Asset Allocation Analysis
- Current vs target allocation
- Sector breakdown
- Geographic distribution
- Market cap distribution

### 4. Diversification Assessment
- Position concentration analysis
- Sector diversification score
- Correlation concerns
- HHI concentration index

### 5. Risk Assessment
- Portfolio beta and volatility
- Maximum drawdown
- Risk concentrations
- Overall risk score

### 6. Performance Review
- Total portfolio value and P/L
- Best and worst performers
- Performance vs benchmark (if available)

### 7. Position Analysis
- Detailed analysis of top 10-15 holdings
- Thesis validation
- Valuation assessment
- Position sizing
- HOLD/ADD/TRIM/SELL recommendations

### 8. Rebalancing Recommendations
- Prioritized actions (High/Medium/Low priority)
- Specific trade recommendations
- Cash deployment suggestions
- Tax considerations

### 9. Action Items
- Immediate actions
- Medium-term tasks
- Monitoring priorities

**Report Location:** `portfolio_analysis_YYYY-MM-DD.md` in repository root

## Reference Materials

The skill includes comprehensive reference documentation:

- **`references/alpaca-mcp-setup.md`** - Alpaca API setup guide
- **`references/asset-allocation.md`** - Asset allocation theory and frameworks
- **`references/diversification-principles.md`** - Diversification concepts and metrics
- **`references/portfolio-risk-metrics.md`** - Risk measurement and interpretation
- **`references/position-evaluation.md`** - Position analysis framework
- **`references/rebalancing-strategies.md`** - Rebalancing methodologies
- **`references/target-allocations.md`** - Model portfolios by risk profile
- **`references/risk-profile-questionnaire.md`** - Risk tolerance assessment

These references are loaded automatically by the skill as needed during analysis.

## Testing Alpaca Connection

Before using the skill, test your Alpaca API connection:

```bash
python3 portfolio-manager/scripts/test_alpaca_connection.py
```

Expected output:
```
✓ Successfully connected to Alpaca API
Account Status: ACTIVE
Equity: $100,000.00
Cash: $50,000.00
Buying Power: $200,000.00
Positions: 5
```

If you see errors, consult `references/alpaca-mcp-setup.md` for troubleshooting.

## Example Workflow

### Initial Portfolio Review

1. **Trigger analysis:**
   ```
   User: "Analyze my portfolio"
   ```

2. **Skill workflow:**
   - Fetches positions from Alpaca MCP
   - Retrieves account information
   - Gathers market data for each position
   - Performs comprehensive analysis
   - Generates detailed report

3. **Report generated:**
   - `portfolio_analysis_2025-11-08.md`
   - Includes all analysis sections
   - Specific recommendations provided

4. **Follow-up questions:**
   ```
   User: "Why should I trim NVDA?"
   User: "What should I buy instead?"
   User: "Is my tech allocation too high?"
   ```

### Ongoing Monitoring

**Quarterly Review:**
```
User: "Review my portfolio for Q4 2025"
```

**After Market Events:**
```
User: "How did the market crash affect my portfolio?"
```

**Before Rebalancing:**
```
User: "Generate rebalancing recommendations"
```

## Key Concepts

### Asset Allocation
Distribution of portfolio across asset classes (stocks, bonds, cash). The primary driver of portfolio risk and return.

### Diversification
Spreading investments across multiple positions, sectors, and geographies to reduce unsystematic risk.

### Rebalancing
Systematically selling overweight positions and buying underweight positions to maintain target allocation.

### Position Sizing
Determining appropriate weight for each holding based on conviction, risk, and portfolio constraints.

### Risk-Adjusted Returns
Evaluating performance relative to risk taken (Sharpe ratio, Sortino ratio).

### Concentration Risk
Excessive exposure to single position, sector, or theme that creates elevated portfolio risk.

## Limitations and Disclaimers

**Important Notes:**

1. **Not Financial Advice** - This tool provides informational analysis only, not personalized financial advice.

2. **Data Accuracy** - Analysis quality depends on Alpaca API data accuracy and third-party market data.

3. **Market Conditions** - Historical analysis may not predict future performance, especially during regime changes.

4. **Tax Implications** - Tax impact estimates are approximate only; consult a tax professional.

5. **Execution Risk** - Recommendations assume ability to execute trades at current market prices.

**Always:**
- Verify critical data independently
- Consult qualified financial advisor before major decisions
- Consider your unique circumstances, risk tolerance, and goals
- Review tax implications with tax professional

## Troubleshooting

### "Alpaca MCP Server not connected"

**Solutions:**
1. Verify MCP server is running (`claude mcp status` if available)
2. Check environment variables are set: `echo $ALPACA_API_KEY`
3. Restart Claude to reinitialize MCP servers
4. Verify API keys in Alpaca dashboard
5. See `references/alpaca-mcp-setup.md` for detailed setup

### "Invalid API credentials"

**Solutions:**
1. Verify API Key ID and Secret Key (no typos, spaces)
2. Check `ALPACA_PAPER` setting matches your keys (paper vs live)
3. Regenerate API keys in Alpaca dashboard
4. Ensure account status is active

### "No positions found"

**Solutions:**
1. Verify positions exist in Alpaca dashboard
2. Confirm you're checking correct account (paper vs live)
3. Check account number matches
4. Try refreshing: ask Claude to fetch positions again

### Report seems inaccurate

**Solutions:**
1. Verify Alpaca data is current (check Alpaca dashboard)
2. Check if market data is delayed (free tier is 15-min delayed)
3. Manually verify a few key positions
4. Report discrepancies to improve analysis

## Version History

- **v1.0** (November 2025) - Initial release
  - Alpaca MCP Server integration
  - Comprehensive portfolio analysis
  - Multi-dimensional risk assessment
  - Position evaluation framework
  - Rebalancing recommendations
  - Model portfolio benchmarks

## Support and Contributing

**For Issues:**
- Check `references/` documentation
- Review troubleshooting section above
- Test Alpaca connection with `test_alpaca_connection.py`
- Check Alpaca API status: https://status.alpaca.markets/

**For Questions:**
- Alpaca API docs: https://alpaca.markets/docs/
- Alpaca community: https://forum.alpaca.markets/

**Skill Enhancement Ideas:**
- Additional broker integrations (Interactive Brokers, Schwab)
- Options portfolio analysis
- Factor exposure analysis
- Monte Carlo retirement projections
- Tax-loss harvesting automation

## Related Skills

This skill works well in combination with:

- **US Stock Analysis** - Deep dive into individual positions
- **Value Dividend Screener** - Find replacement stocks for rebalancing
- **Market News Analyst** - Understand recent market-moving events
- **Sector Analyst** - Analyze sector rotation patterns
- **US Market Bubble Detector** - Assess overall market risk environment

## License

See repository root for license information.

---

**Remember:** Successful portfolio management requires discipline, patience, and long-term perspective. Use this skill to maintain systematic approach and avoid emotional decision-making. The best portfolio is one you can stick with through all market conditions.


path: references/alpaca-mcp-setup.md
content: # Alpaca MCP Server Setup Guide

This guide explains how to set up and configure the Alpaca MCP (Model Context Protocol) Server for use with the Portfolio Manager skill.

## What is Alpaca MCP Server?

The Alpaca MCP Server is a Model Context Protocol server that provides Claude with access to your Alpaca brokerage account data through a standardized interface. This allows the Portfolio Manager skill to fetch real-time portfolio positions, account information, and transaction history directly from your Alpaca account.

## Prerequisites

### 1. Alpaca Account

You need an Alpaca brokerage account (paper trading or live):

- **Sign up:** https://alpaca.markets/
- **Paper Trading:** Free, uses simulated money (recommended for testing)
- **Live Trading:** Real money account (requires funding)

### 2. Alpaca API Keys

Generate API keys from your Alpaca dashboard:

**For Paper Trading:**
1. Log into Alpaca dashboard: https://app.alpaca.markets/
2. Navigate to "Paper Trading" account
3. Go to "Your API Keys" section
4. Click "Generate New Key"
5. Save your:
   - **API Key ID** (public key)
   - **Secret Key** (private key - only shown once!)

**For Live Trading:**
1. Log into Alpaca dashboard
2. Navigate to "Live Trading" account
3. Go to "Your API Keys" section
4. Click "Generate New Key"
5. Save your API credentials

⚠️ **Security Note:** Never share your Secret Key or commit it to version control. Treat it like a password.

## Installation

### Option 1: Using MCP Server (Recommended for Claude Desktop/Web)

**Step 1: Install Alpaca MCP Server**

The Alpaca MCP server may be available through Claude's MCP marketplace or as a standalone package.

Check if available in your Claude environment:
```bash
# List available MCP servers
claude mcp list
```

If not installed, follow Anthropic's MCP server installation guide for your platform.

**Step 2: Configure API Keys**

Set environment variables with your Alpaca credentials:

**On macOS/Linux:**
```bash
# For Paper Trading
export ALPACA_API_KEY="your_api_key_id"
export ALPACA_SECRET_KEY="your_secret_key"
export ALPACA_PAPER=true

# For Live Trading
export ALPACA_API_KEY="your_api_key_id"
export ALPACA_SECRET_KEY="your_secret_key"
export ALPACA_PAPER=false
```

Add to `~/.bashrc` or `~/.zshrc` to persist across sessions:
```bash
echo 'export ALPACA_API_KEY="your_api_key_id"' >> ~/.bashrc
echo 'export ALPACA_SECRET_KEY="your_secret_key"' >> ~/.bashrc
echo 'export ALPACA_PAPER=true' >> ~/.bashrc
source ~/.bashrc
```

**On Windows (PowerShell):**
```powershell
# For Paper Trading
$env:ALPACA_API_KEY="your_api_key_id"
$env:ALPACA_SECRET_KEY="your_secret_key"
$env:ALPACA_PAPER="true"

# For Live Trading
$env:ALPACA_API_KEY="your_api_key_id"
$env:ALPACA_SECRET_KEY="your_secret_key"
$env:ALPACA_PAPER="false"
```

To persist environment variables on Windows:
```powershell
[System.Environment]::SetEnvironmentVariable('ALPACA_API_KEY', 'your_api_key_id', 'User')
[System.Environment]::SetEnvironmentVariable('ALPACA_SECRET_KEY', 'your_secret_key', 'User')
[System.Environment]::SetEnvironmentVariable('ALPACA_PAPER', 'true', 'User')
```

**Step 3: Start MCP Server**

The MCP server should start automatically when Claude launches. Verify connection:
```bash
# Check MCP server status (if CLI available)
claude mcp status
```

### Option 2: Direct API Integration (Alternative)

If MCP server is unavailable, the skill can fall back to direct Alpaca API integration using Python:

**Step 1: Install Alpaca Python SDK**
```bash
pip install alpaca-trade-api
```

**Step 2: Create Configuration File**

Create `~/.alpaca/config.ini`:
```ini
[alpaca]
api_key_id = your_api_key_id
secret_key = your_secret_key
base_url = https://paper-api.alpaca.markets  # For paper trading
# base_url = https://api.alpaca.markets     # For live trading
```

Set proper permissions:
```bash
chmod 600 ~/.alpaca/config.ini
```

**Step 3: Test Connection**

Use the provided test script:
```bash
python3 portfolio-manager/scripts/test_alpaca_connection.py
```

Expected output:
```
✓ Successfully connected to Alpaca API
Account Status: ACTIVE
Equity: $100,000.00
Cash: $50,000.00
Buying Power: $200,000.00
Positions: 5
```

## Available MCP Tools

Once configured, the Portfolio Manager skill can use these Alpaca MCP tools:

### `mcp__alpaca__get_account_info`
Fetches account summary:
- Total equity (portfolio value)
- Cash balance
- Buying power
- Account status
- Day trading buying power (if applicable)

### `mcp__alpaca__get_positions`
Retrieves all open positions:
- Symbol ticker
- Quantity (shares)
- Average entry price (cost basis)
- Current market price
- Current market value
- Unrealized P&L ($ and %)
- Today's P&L

### `mcp__alpaca__get_portfolio_history`
Gets historical portfolio performance:
- Equity time series
- Profit/loss time series
- Timeframes: 1D, 1W, 1M, 3M, 1Y, All

### `mcp__alpaca__get_orders`
Lists orders (open, filled, cancelled):
- Order ID
- Symbol
- Quantity
- Order type (market, limit, stop, etc.)
- Status
- Fill price (if filled)
- Timestamps

### `mcp__alpaca__get_activities`
Retrieves account activities:
- Trades (fills)
- Dividend payments
- Stock splits
- Journal entries

## Verification and Testing

### Test 1: Account Connection

Ask Claude to fetch account info:
```
"Can you get my Alpaca account information?"
```

Expected response should include your equity, cash, and buying power.

### Test 2: Portfolio Positions

Request current positions:
```
"What positions do I have in my portfolio?"
```

Expected response should list all holdings with quantities and values.

### Test 3: Portfolio Analysis

Trigger the Portfolio Manager skill:
```
"Analyze my portfolio"
```

The skill should:
1. Fetch positions via MCP
2. Gather additional market data
3. Perform comprehensive analysis
4. Generate detailed report

## Troubleshooting

### Error: "Alpaca MCP Server not connected"

**Possible causes:**
1. MCP server not running
2. API keys not configured
3. API keys invalid or expired

**Solutions:**
1. Restart Claude to reinitialize MCP servers
2. Verify environment variables are set: `echo $ALPACA_API_KEY`
3. Check API keys in Alpaca dashboard (regenerate if needed)
4. Verify account status (ensure not suspended)

### Error: "Invalid API credentials"

**Possible causes:**
1. Wrong API keys
2. Using live keys with paper mode (or vice versa)
3. API keys revoked

**Solutions:**
1. Double-check API Key ID and Secret Key (no extra spaces)
2. Verify `ALPACA_PAPER` setting matches your API keys
3. Regenerate API keys in Alpaca dashboard
4. Ensure you're using the correct account (paper vs live)

### Error: "Forbidden - insufficient permissions"

**Possible causes:**
1. API keys have restricted permissions
2. Account not approved for trading

**Solutions:**
1. Regenerate API keys with full permissions
2. Check Alpaca dashboard for account status
3. For live accounts, ensure account approval is complete

### Error: "No positions found"

**Possible causes:**
1. Portfolio is actually empty
2. Wrong account selected (paper vs live)
3. API returning stale data

**Solutions:**
1. Verify positions exist in Alpaca dashboard
2. Confirm `ALPACA_PAPER` setting matches intended account
3. Try refreshing: ask Claude to fetch positions again
4. Check Alpaca API status page: https://status.alpaca.markets/

### MCP Server Not Responding

**Solutions:**
1. Restart Claude application
2. Check MCP server logs (if available)
3. Verify network connectivity
4. Fall back to direct API integration (Option 2)

## Security Best Practices

### 1. Use Paper Trading for Testing
Always test with paper trading account first. Never risk real money until thoroughly tested.

### 2. Protect API Keys
- Never commit API keys to GitHub or version control
- Use environment variables, not hardcoded values
- Set file permissions: `chmod 600` for config files
- Rotate keys periodically (every 90 days)

### 3. Use Read-Only Keys (If Available)
For portfolio analysis only, use read-only API keys if Alpaca supports them. This prevents accidental trading.

### 4. Monitor API Usage
- Check Alpaca dashboard for API call logs
- Review account activities regularly
- Set up alerts for unusual activity

### 5. Separate Paper and Live Environments
- Use different environment variable prefixes
- Never mix paper and live credentials
- Document which keys are which

## API Rate Limits

Alpaca imposes rate limits on API calls:

**Free Tier:**
- 200 requests per minute
- Data delayed by 15 minutes (for free market data)

**Paid Tier (Alpaca Markets Data subscription):**
- Higher rate limits
- Real-time data

**Best Practices:**
- Portfolio Manager skill includes built-in rate limiting
- Avoid running analysis more than once per minute
- For frequent monitoring, consider caching results

## Alternative: Manual Data Entry

If Alpaca integration is unavailable, Portfolio Manager can accept manually entered portfolio data:

**CSV Format:**
```csv
symbol,quantity,cost_basis,current_price
AAPL,100,150.00,175.50
MSFT,50,280.00,310.25
GOOGL,25,2500.00,2750.00
```

**Usage:**
1. Export positions from your broker as CSV
2. Provide file to Claude: "Analyze my portfolio using this CSV file"
3. Skill will parse data and perform analysis

**Limitations:**
- No real-time updates
- No historical performance data
- Manual updates required

## Additional Resources

**Alpaca Documentation:**
- API docs: https://alpaca.markets/docs/
- Python SDK: https://github.com/alpacahq/alpaca-trade-api-python
- API reference: https://alpaca.markets/docs/api-references/trading-api/

**MCP Protocol:**
- Anthropic MCP docs: https://docs.anthropic.com/claude/docs/model-context-protocol
- MCP specification: https://github.com/anthropics/mcp

**Support:**
- Alpaca support: [REDACTED_SECRET]
- Alpaca community: https://forum.alpaca.markets/
- API status: https://status.alpaca.markets/


path: references/asset-allocation.md
content: # Asset Allocation Framework

This document provides comprehensive guidance on asset allocation principles, target allocations by risk profile, and rebalancing triggers for portfolio management.

## Core Principles

### 1. Asset Allocation Drives Returns

Academic research shows that asset allocation accounts for approximately 90% of portfolio return variability over time. Security selection and market timing contribute far less to long-term outcomes.

**Key Insight:** Getting the allocation right is more important than picking individual stocks.

### 2. Diversification Across Asset Classes

Different asset classes have different risk-return characteristics and respond differently to economic conditions:

| Asset Class | Expected Return | Volatility | Purpose |
|-------------|----------------|------------|---------|
| **Stocks (Equities)** | 8-10% | High (15-20%) | Growth, long-term appreciation |
| **Bonds (Fixed Income)** | 3-5% | Low (3-6%) | Income, capital preservation, volatility dampening |
| **Cash & Equivalents** | 1-2% | Very Low | Liquidity, stability, opportunistic deployment |
| **Real Estate** | 6-8% | Medium (10-15%) | Income, inflation hedge, diversification |
| **Commodities** | 4-6% | High (15-25%) | Inflation hedge, diversification |
| **Alternatives** | Varies | Varies | Non-correlated returns, risk management |

*Note: Returns are historical long-term averages and not guaranteed. Actual returns vary significantly.*

### 3. Risk Tolerance Alignment

Asset allocation should match investor's risk tolerance and time horizon:

- **Risk Capacity:** Financial ability to withstand losses (net worth, income stability, time horizon)
- **Risk Tolerance:** Emotional ability to withstand volatility (behavioral, psychological)
- **Risk Requirement:** Return needed to achieve financial goals

Optimal allocation balances all three factors.

## Asset Allocation by Risk Profile

### Conservative (Capital Preservation)

**Investor Profile:**
- Age: Typically 60+ or near retirement
- Time Horizon: 0-5 years
- Primary Goal: Preserve capital, generate income
- Risk Tolerance: Low - cannot afford significant losses
- Volatility Tolerance: Minimal (<5-8% annual drawdown)

**Target Allocation:**
- **Stocks:** 20-40%
  - US Large Cap: 15-25%
  - US Small/Mid Cap: 0-5%
  - International: 5-10%
- **Bonds:** 50-70%
  - Investment Grade Corporate: 20-30%
  - Government Bonds: 20-30%
  - High Yield: 0-10%
- **Cash:** 10-20%
- **Alternatives:** 0-10%

**Sector Guidelines (Equity Portion):**
- Defensive sectors: 60-70% (Utilities, Consumer Staples, Healthcare)
- Cyclical sectors: 30-40%
- Avoid: High-growth tech, speculative stocks

**Expected Outcomes:**
- Annual Return: 4-6%
- Max Drawdown: -10 to -15%
- Recovery Time: 1-2 years

### Moderate (Balanced Growth & Income)

**Investor Profile:**
- Age: Typically 40-60
- Time Horizon: 5-15 years
- Primary Goal: Balanced growth and income
- Risk Tolerance: Medium - can handle moderate volatility
- Volatility Tolerance: Moderate (10-15% annual drawdown)

**Target Allocation:**
- **Stocks:** 50-70%
  - US Large Cap: 30-40%
  - US Small/Mid Cap: 10-15%
  - International: 10-15%
- **Bonds:** 25-40%
  - Investment Grade Corporate: 15-25%
  - Government Bonds: 5-10%
  - High Yield: 5-10%
- **Cash:** 5-10%
- **Alternatives:** 0-10%

**Sector Guidelines (Equity Portion):**
- Defensive sectors: 40-50%
- Growth sectors: 30-40% (Technology, Communication, Consumer Discretionary)
- Cyclical sectors: 20-30% (Industrials, Financials, Materials)

**Expected Outcomes:**
- Annual Return: 6-8%
- Max Drawdown: -15 to -25%
- Recovery Time: 2-4 years

### Growth (Long-Term Capital Appreciation)

**Investor Profile:**
- Age: Typically 30-50
- Time Horizon: 10-25 years
- Primary Goal: Long-term wealth accumulation
- Risk Tolerance: Medium-High - can withstand volatility for higher returns
- Volatility Tolerance: Significant (15-20% annual drawdown)

**Target Allocation:**
- **Stocks:** 75-90%
  - US Large Cap: 40-50%
  - US Small/Mid Cap: 15-20%
  - International: 15-20%
  - Emerging Markets: 5-10%
- **Bonds:** 10-20%
  - Investment Grade Corporate: 5-10%
  - High Yield: 5-10%
- **Cash:** 2-5%
- **Alternatives:** 0-10%

**Sector Guidelines (Equity Portion):**
- Growth sectors: 45-55% (Technology, Healthcare, Communication)
- Cyclical sectors: 25-35%
- Defensive sectors: 20-30%

**Expected Outcomes:**
- Annual Return: 8-10%
- Max Drawdown: -20 to -35%
- Recovery Time: 3-5 years

### Aggressive (Maximum Growth)

**Investor Profile:**
- Age: Typically <40 or high net worth with long horizon
- Time Horizon: 15+ years
- Primary Goal: Maximize wealth, comfortable with high risk
- Risk Tolerance: High - can emotionally and financially withstand major losses
- Volatility Tolerance: Very high (20-30%+ annual drawdown)

**Target Allocation:**
- **Stocks:** 90-100%
  - US Large Cap: 40-50%
  - US Small/Mid Cap: 20-25%
  - International: 15-20%
  - Emerging Markets: 10-15%
  - Alternatives: 0-5%
- **Bonds:** 0-10%
- **Cash:** 0-5%

**Sector Guidelines (Equity Portion):**
- Growth sectors: 50-60% (Technology, Healthcare, Consumer Discretionary)
- Cyclical sectors: 30-35%
- Defensive sectors: 10-20%
- May include speculative positions (small caps, growth stocks)

**Expected Outcomes:**
- Annual Return: 9-12%
- Max Drawdown: -30 to -50%
- Recovery Time: 4-7 years

## Sector Allocation Guidelines

### Defensive Sectors (Lower Volatility)

**Utilities (3-5% of equity allocation)**
- Characteristics: Stable cash flows, dividend-focused, regulated
- Economic Sensitivity: Low
- Use: Income generation, volatility dampening
- Overweight when: Late cycle, high uncertainty, rising rates

**Consumer Staples (5-10%)**
- Characteristics: Steady demand, pricing power, recession-resistant
- Economic Sensitivity: Low
- Use: Stability, dividend income
- Overweight when: Economic slowdown, defensive posture

**Healthcare (10-15%)**
- Characteristics: Demographic tailwinds, innovation-driven, essential services
- Economic Sensitivity: Low to Medium
- Use: Growth with defensive qualities
- Overweight when: Aging demographics, innovation cycle

### Growth Sectors (Higher Volatility, Higher Expected Returns)

**Technology (15-25%)**
- Characteristics: High growth, innovation-driven, secular trends
- Economic Sensitivity: Medium to High
- Use: Capital appreciation, secular growth
- Overweight when: Economic expansion, innovation cycles, low rates
- Caution: Concentration risk, valuation sensitivity

**Communication Services (5-10%)**
- Characteristics: Platform businesses, network effects, advertising-driven
- Economic Sensitivity: Medium
- Use: Growth, secular trends (digital transformation)
- Overweight when: Ad market strength, content consumption growth

**Consumer Discretionary (8-12%)**
- Characteristics: Cyclical demand, premium brands, e-commerce
- Economic Sensitivity: High
- Use: Economic growth exposure, consumer trends
- Overweight when: Strong consumer confidence, wage growth

### Cyclical Sectors (Economic Cycle Sensitive)

**Financials (10-15%)**
- Characteristics: Interest rate sensitive, credit cycle dependent
- Economic Sensitivity: High
- Use: Economic expansion exposure, dividend income
- Overweight when: Rising rates, strong economy, steepening yield curve

**Industrials (8-12%)**
- Characteristics: Capital goods, infrastructure, global trade
- Economic Sensitivity: High
- Use: Economic growth, infrastructure spending
- Overweight when: Fiscal stimulus, manufacturing upturn, globalization

**Materials (3-6%)**
- Characteristics: Commodity-driven, economic cycle dependent
- Economic Sensitivity: Very High
- Use: Inflation hedge, economic growth
- Overweight when: Infrastructure spending, commodity supercycles

**Energy (3-8%)**
- Characteristics: Commodity price driven, capital intensive, volatile
- Economic Sensitivity: High
- Use: Inflation hedge, commodity exposure
- Overweight when: Rising oil prices, underinvestment supply cycles
- Caution: ESG concerns, energy transition risk

**Real Estate (3-6%)**
- Characteristics: Income-focused, interest rate sensitive, inflation hedge
- Economic Sensitivity: Medium
- Use: Diversification, income, inflation protection
- Overweight when: Low rates, economic expansion, inflation

## Geographic Allocation

### US Equities (60-75% of total equity)

**Rationale:**
- Home market bias (reduce currency risk, familiar companies)
- Deepest, most liquid markets
- Strong corporate governance and shareholder rights
- Dollar-denominated returns

**Allocation by Market Cap:**
- Large Cap (>$10B): 60-70% of US equity
- Mid Cap ($2B-$10B): 20-25%
- Small Cap (<$2B): 10-15%

### International Developed Markets (15-25% of total equity)

**Regions:**
- Europe: 8-12%
- Japan: 3-5%
- UK: 2-4%
- Other (Canada, Australia): 2-4%

**Rationale:**
- Diversification (different economic cycles)
- Currency diversification
- Access to global industry leaders
- Valuation opportunities

**Considerations:**
- Currency risk (hedge or leave unhedged based on view)
- Political risk (EU regulatory environment, Brexit impact)
- Lower growth rates vs US

### Emerging Markets (5-15% of total equity)

**Regions:**
- China: 2-5%
- India: 1-3%
- Other Asia (Taiwan, Korea): 1-3%
- Latin America: 0-2%
- Other: 0-2%

**Rationale:**
- Higher growth potential
- Demographic advantages
- Commodity exposure
- Diversification

**Considerations:**
- Higher volatility
- Political and regulatory risk
- Currency volatility
- Liquidity concerns

**Risk Management:**
- Limit to 5-10% for moderate investors
- Use broad ETFs rather than individual stocks
- Monitor geopolitical developments

## Rebalancing Framework

### Rebalancing Triggers

**1. Time-Based Rebalancing**
- **Frequency:** Quarterly or Semi-Annually
- **Methodology:** Review allocation every 3-6 months, rebalance if needed
- **Pros:** Disciplined, predictable, simple
- **Cons:** May rebalance when not necessary (costs), or miss urgent needs

**2. Threshold-Based Rebalancing**
- **Trigger:** Allocation drifts >5% from target
- **Example:** If target is 60% stocks, rebalance when stocks reach <55% or >65%
- **Pros:** Responsive to market moves, cost-efficient
- **Cons:** Requires monitoring, may miss small drifts

**3. Hybrid Approach (Recommended)**
- **Method:** Check quarterly, rebalance only if drift >5%
- **Best of both worlds:** Disciplined review, cost-conscious execution

### Rebalancing Thresholds

| Allocation Drift | Action | Priority |
|-----------------|--------|----------|
| **<3%** | Monitor, no action needed | None |
| **3-5%** | Consider rebalancing (optional) | Low |
| **5-10%** | Rebalance recommended | Medium |
| **>10%** | Rebalance immediately | High |

**Position-Level Thresholds:**
- Single stock >15% of portfolio → Trim immediately
- Single stock >20% of portfolio → Urgent trim required
- Any position doubling target weight → Review and likely trim

### Rebalancing Methods

**1. Sell and Redeploy**
- **Method:** Sell overweight positions, buy underweight positions
- **Pros:** Precise rebalancing
- **Cons:** Tax implications (capital gains), transaction costs

**2. Direct New Contributions**
- **Method:** Use new cash to buy underweight positions
- **Pros:** No selling (tax-efficient), simple
- **Cons:** Slower rebalancing, requires regular contributions

**3. Dividend Reinvestment**
- **Method:** Reinvest dividends into underweight positions
- **Pros:** Tax-efficient, gradual rebalancing
- **Cons:** Very slow, limited impact

**4. Opportunistic (Tactical)**
- **Method:** Sell overweight positions on strength, buy underweight on weakness
- **Pros:** Improve execution prices
- **Cons:** Requires active monitoring, may delay rebalancing

**Recommendation:** Use method #1 (sell and redeploy) for large drifts (>10%), method #2 for small drifts (<5%), and method #4 when actively managing.

### Tax Considerations

**Tax-Loss Harvesting:**
- Sell positions with losses to offset capital gains
- Reinvest in similar (but not substantially identical) securities
- Avoid wash sale rule (30-day rule)

**Tax-Efficient Rebalancing:**
- Prioritize rebalancing in tax-advantaged accounts (IRA, 401k)
- In taxable accounts, hold winners >1 year for long-term capital gains rates
- Use new contributions to rebalance rather than selling

**Timing:**
- Rebalance in December to harvest losses
- Rebalance in January to deploy fresh capital
- Avoid year-end if sitting on large gains (defer taxes)

## Tactical Adjustments

While strategic asset allocation should be stable, tactical adjustments can enhance returns:

### Market Cycle Adjustments

**Early Bull Market:**
- Overweight: Cyclicals (Financials, Industrials, Materials)
- Underweight: Defensives (Utilities, Staples)
- Rationale: Economic acceleration favors cyclical sectors

**Mid Bull Market:**
- Overweight: Growth (Technology, Healthcare)
- Neutral: Cyclicals and Defensives
- Rationale: Expansion matures, focus on quality growth

**Late Bull Market:**
- Overweight: Defensives (Utilities, Staples, Healthcare)
- Underweight: Cyclicals
- Rationale: Prepare for slowdown, reduce beta

**Bear Market:**
- Overweight: Cash, Bonds, Defensive equities
- Underweight: Cyclical equities
- Rationale: Capital preservation, prepare for recovery

### Valuation-Based Adjustments

**When US stocks expensive (high Shiller PE >30):**
- Reduce US equity allocation by 5-10%
- Increase international or value stocks
- Increase cash/bonds

**When sectors extremely overvalued:**
- Trim sector allocation by 3-5%
- Redistribute to undervalued sectors
- Maintain overall equity target

### Interest Rate Adjustments

**Rising Rate Environment:**
- Shorten bond duration
- Overweight: Financials, Value stocks
- Underweight: High P/E growth, Utilities, REITs

**Falling Rate Environment:**
- Lengthen bond duration
- Overweight: Growth stocks, Technology, REITs
- Underweight: Financials

## Common Mistakes to Avoid

### 1. Market Timing
**Mistake:** Drastically changing allocation based on market predictions
**Impact:** Missing recoveries, buying high/selling low
**Solution:** Stick to strategic allocation, make only minor tactical adjustments

### 2. Over-Diversification
**Mistake:** Holding 100+ positions across 50 funds
**Impact:** Closet indexing, high fees, complexity
**Solution:** 15-30 individual stocks OR 5-10 ETFs for most investors

### 3. Under-Diversification
**Mistake:** Heavy concentration in single stock/sector (often employer stock)
**Impact:** Excessive risk, correlated life outcomes (job + portfolio)
**Solution:** Limit single stock to <10%, single sector to <25%

### 4. Ignoring Rebalancing
**Mistake:** "Let winners run" indefinitely
**Impact:** Portfolio drifts to high risk, concentration increases
**Solution:** Disciplined rebalancing schedule, trim winners

### 5. Emotional Rebalancing
**Mistake:** Panic selling in crashes, euphoric buying in bubbles
**Impact:** Locking in losses, buying tops
**Solution:** Systematic rebalancing rules, ignore emotions

### 6. Chasing Performance
**Mistake:** Shifting to last year's top-performing sectors
**Impact:** Mean reversion, buying expensive
**Solution:** Maintain strategic allocation, resist recency bias

## Allocation Review Checklist

Use this checklist when reviewing portfolio allocation:

**Asset Class Level:**
- [ ] Current stock/bond/cash allocation vs target (within 5%?)
- [ ] Risk profile still appropriate for goals/timeline?
- [ ] Any major life changes requiring allocation shift?
- [ ] Tax considerations for rebalancing?

**Sector Level:**
- [ ] Any sector >30% of equity allocation?
- [ ] Defensive sectors appropriate for market cycle?
- [ ] Growth vs value balance appropriate?
- [ ] Sector allocations reasonable vs benchmark?

**Geographic Level:**
- [ ] US vs International allocation on target?
- [ ] Emerging market exposure appropriate for risk tolerance?
- [ ] Any country concentration concerns?
- [ ] Currency exposure considerations?

**Position Level:**
- [ ] Any single stock >15% of portfolio?
- [ ] Top 10 holdings represent what % of portfolio?
- [ ] Any highly correlated positions creating concentration?
- [ ] Position sizes match conviction and risk?

**Performance Level:**
- [ ] Performance vs benchmark acceptable?
- [ ] Any positions consistently underperforming?
- [ ] Winners becoming too large (>2x initial allocation)?
- [ ] Losers requiring re-evaluation (broken thesis)?

## Summary

**Key Takeaways:**

1. **Asset allocation is the primary driver of returns** - Get the big picture right
2. **Match allocation to risk tolerance and time horizon** - Don't take more risk than you can handle
3. **Diversify across asset classes, sectors, and geographies** - Don't put all eggs in one basket
4. **Rebalance systematically** - Trim winners, add to losers, maintain discipline
5. **Minimize taxes and costs** - Tax-efficient rebalancing, low-cost implementation
6. **Stay the course** - Avoid emotional decisions, stick to the plan
7. **Review regularly but change rarely** - Annual review, infrequent major changes

**Remember:** Asset allocation should reflect your personal circumstances, not market forecasts. The best allocation is one you can stick with through market cycles.


path: references/diversification-principles.md
content: # Diversification Principles

This document explains the theory and practice of portfolio diversification, providing frameworks for assessing diversification quality and identifying concentration risks.

## Core Concepts

### What is Diversification?

Diversification is the practice of spreading investments across various assets, sectors, and geographies to reduce portfolio risk without proportionally reducing expected returns.

**Harry Markowitz's Key Insight (1952):**
> "Diversification is the only free lunch in finance."

By combining assets with imperfect correlation, investors can achieve better risk-adjusted returns than holding individual securities.

### The Math Behind Diversification

**Portfolio Risk Formula:**

For a two-asset portfolio:
```
σ_p = √(w₁²σ₁² + w₂²σ₂² + 2w₁w₂σ₁σ₂ρ₁₂)

Where:
σ_p = Portfolio standard deviation (risk)
w₁, w₂ = Weights of assets 1 and 2
σ₁, σ₂ = Standard deviations of assets 1 and 2
ρ₁₂ = Correlation between assets 1 and 2
```

**Key Insight:** When correlation < 1.0, portfolio risk is less than the weighted average of individual risks.

### Types of Risk

**1. Systematic Risk (Market Risk)**
- **Definition:** Risk inherent to the entire market
- **Examples:** Recessions, interest rate changes, geopolitical events
- **Cannot be eliminated** by diversification
- **Beta** measures exposure to systematic risk

**2. Unsystematic Risk (Specific Risk)**
- **Definition:** Risk specific to individual companies or sectors
- **Examples:** Management failures, product recalls, competitive losses
- **Can be reduced** through diversification
- **Diversification benefit:** Holding 15-30 stocks eliminates ~90% of unsystematic risk

**Modern Portfolio Theory Goal:** Eliminate unsystematic risk while accepting systematic risk (compensated by market risk premium).

## Optimal Number of Holdings

### Individual Stocks

Research shows diminishing diversification benefits beyond a certain number of holdings:

| Number of Stocks | % of Unsystematic Risk Eliminated |
|------------------|----------------------------------|
| 1 | 0% (all risk remains) |
| 5 | ~40% |
| 10 | ~65% |
| 15 | ~75% |
| 20 | ~85% |
| 30 | ~90% |
| 50 | ~93% |
| 100 | ~95% |

**Recommended Range: 15-30 stocks**

**Why not more than 30?**
- Marginal diversification benefit very small
- Increased complexity and monitoring burden
- Higher transaction costs
- Diluted impact of high-conviction ideas
- "Closet indexing" (might as well own an ETF)

**Why not fewer than 15?**
- Insufficient elimination of unsystematic risk
- Concentration risk remains significant
- Single-stock events can severely impact portfolio
- Correlation underestimation risk

### ETFs and Mutual Funds

**For diversified funds (broad market, sector, international):**
- **5-10 ETFs** can provide excellent diversification
- Each ETF already holds dozens to thousands of stocks
- Focus on low overlap and complementary exposures

**Example Well-Diversified 6-ETF Portfolio:**
1. US Large Cap (S&P 500)
2. US Small/Mid Cap
3. International Developed Markets
4. Emerging Markets
5. US Bonds (Aggregate)
6. Real Estate (REITs)

## Correlation and Diversification

### Understanding Correlation

**Correlation coefficient (ρ) ranges from -1.0 to +1.0:**

| Correlation | Interpretation | Diversification Benefit |
|-------------|----------------|------------------------|
| **+1.0** | Perfect positive correlation | None (redundant holdings) |
| **+0.7 to +0.9** | Very high correlation | Minimal |
| **+0.3 to +0.7** | Moderate positive correlation | Good |
| **0 to +0.3** | Low positive correlation | Excellent |
| **0** | No correlation | Maximum benefit |
| **-0.3 to 0** | Low negative correlation | Excellent (hedging) |
| **< -0.3** | Moderate to strong negative correlation | Hedging properties |

### Typical Stock Correlations

**Within Same Sector:**
- Large tech stocks (AAPL, MSFT, GOOGL): ρ ≈ 0.6-0.8
- Banks (JPM, BAC, WFC): ρ ≈ 0.7-0.9
- Oil companies (XOM, CVX): ρ ≈ 0.8-0.9

**Across Different Sectors:**
- Tech vs Healthcare: ρ ≈ 0.3-0.5
- Utilities vs Technology: ρ ≈ 0.2-0.4
- Consumer Staples vs Energy: ρ ≈ 0.3-0.5

**Defensive vs Cyclical:**
- Utilities vs Industrials: ρ ≈ 0.2-0.4
- Consumer Staples vs Consumer Discretionary: ρ ≈ 0.4-0.6

**US vs International:**
- US stocks vs International Developed: ρ ≈ 0.7-0.9 (increasing over time)
- US stocks vs Emerging Markets: ρ ≈ 0.6-0.8

**Stocks vs Bonds:**
- US Stocks vs US Treasuries: ρ ≈ -0.2 to +0.3 (varies by regime)
- Stocks vs Corporate Bonds: ρ ≈ 0.4-0.6

### Correlation Pitfalls

**1. Correlation Instability**
- Correlations increase during market crashes ("correlation goes to 1 in a crisis")
- Diversification benefits diminish when most needed
- Solution: Include truly uncorrelated assets (gold, volatility strategies)

**2. Hidden Correlations**
- Stocks may appear different but share common risk factors
- Example: Bank stocks + homebuilders both exposed to interest rates
- Solution: Analyze underlying risk factors, not just sector labels

**3. Globalization Effect**
- International diversification less effective than historically
- US and global markets increasingly correlated
- Solution: Still valuable, but expect lower diversification benefit than in past

## Concentration Risk Measurement

### Position Concentration

**Single Position Thresholds:**

| Position Size | Risk Level | Action |
|---------------|------------|--------|
| **<5%** | Low | Acceptable for all positions |
| **5-10%** | Medium | Monitor, ensure high conviction |
| **10-15%** | High | Trim recommended unless exceptional conviction |
| **15-20%** | Very High | Trim immediately (except rare cases) |
| **>20%** | Extreme | Urgent trim required |

**Top Holdings Concentration:**

| Top 5 Holdings | Risk Assessment |
|----------------|-----------------|
| **<25%** | Well-diversified |
| **25-40%** | Moderate concentration |
| **40-60%** | High concentration |
| **>60%** | Excessive concentration |

**Example:**
- If top 5 positions = 55% of portfolio → High concentration risk
- If largest single position = 18% → Immediate trim recommended

### Sector Concentration

**Sector Allocation Thresholds:**

| Sector Weight | Risk Level | Guidance |
|---------------|------------|----------|
| **<15%** | Underweight | May be intentional or opportunity |
| **15-25%** | Normal | Typical for major sectors |
| **25-30%** | Moderate overweight | Monitor, ensure intentional |
| **30-40%** | High overweight | Trim recommended |
| **>40%** | Excessive concentration | Urgent diversification needed |

**S&P 500 Sector Benchmarks (approximate):**
- Technology: 25-30%
- Healthcare: 12-15%
- Financials: 10-13%
- Consumer Discretionary: 10-12%
- Communication Services: 8-10%
- Industrials: 8-10%
- Consumer Staples: 6-8%
- Energy: 3-5%
- Utilities: 2-3%
- Real Estate: 2-3%
- Materials: 2-3%

**Deviation Analysis:**
- **>10% above benchmark** = Significant overweight (ensure intentional)
- **>20% above benchmark** = Excessive overweight (trim recommended)

### Herfindahl-Hirschman Index (HHI)

**Formula:**
```
HHI = Σ(w_i × 100)²

Where w_i = weight of position i (as decimal)
```

**Interpretation:**

| HHI Score | Concentration Level | Portfolio Characteristics |
|-----------|---------------------|--------------------------|
| **<1000** | Low concentration | Well-diversified (25+ equal positions) |
| **1000-1800** | Moderate concentration | Typical diversified portfolio (15-25 stocks) |
| **1800-2500** | High concentration | Concentrated portfolio (8-15 stocks) |
| **>2500** | Very high concentration | Very concentrated (5-8 stocks) |
| **>4000** | Extreme concentration | Poorly diversified (<5 stocks) |

**Example Calculation:**

Portfolio with 5 positions:
- Position A: 30% → (30)² = 900
- Position B: 25% → (25)² = 625
- Position C: 20% → (20)² = 400
- Position D: 15% → (15)² = 225
- Position E: 10% → (10)² = 100

HHI = 900 + 625 + 400 + 225 + 100 = **2250** (High concentration)

## Multi-Dimensional Diversification

Effective diversification requires spreading risk across multiple dimensions:

### 1. Number of Holdings (Quantity)
- **Target:** 15-30 individual stocks OR 5-10 diversified funds
- **Measure:** Count of positions
- **Risk:** Too few = concentration; too many = over-diversification

### 2. Position Sizing (Weight)
- **Target:** No single position >10-15%, top 5 <40%
- **Measure:** HHI, top-N concentration
- **Risk:** Unequal weighting creates concentration despite many holdings

### 3. Sector Allocation (Industry)
- **Target:** No sector >30-35%, diversified across 6+ sectors
- **Measure:** Sector breakdown, compare to benchmark
- **Risk:** Industry-specific shocks (e.g., tech crash 2000, financial crisis 2008)

### 4. Market Cap (Size)
- **Target:** Mix of large-cap (60-70%), mid-cap (20-25%), small-cap (10-15%)
- **Measure:** Weighted average market cap, cap-based breakdown
- **Risk:** Small caps more volatile; large caps may underperform in recoveries

### 5. Geography (Region)
- **Target:** US 60-75%, International Developed 15-25%, Emerging Markets 5-15%
- **Measure:** Revenue geography, listing geography
- **Risk:** Country-specific risks (politics, currency, regulation)

### 6. Style (Growth vs Value)
- **Target:** Balanced or slight tilt based on market cycle
- **Measure:** Average P/E, P/B, growth rates of holdings
- **Risk:** Style rotation (growth outperforms in some periods, value in others)

### 7. Correlation (Independence)
- **Target:** Average pairwise correlation <0.6
- **Measure:** Correlation matrix of holdings
- **Risk:** High correlation = false diversification

### 8. Factor Exposures (Risk Factors)
- **Target:** Balanced exposure to momentum, quality, volatility, etc.
- **Measure:** Factor loadings (requires advanced analytics)
- **Risk:** Concentrated factor bets (e.g., all momentum stocks)

## Practical Diversification Strategies

### Strategy 1: Equal Weighting

**Method:** Each position gets equal allocation (e.g., 20 stocks = 5% each)

**Pros:**
- Simple to implement
- Automatic rebalancing to smaller positions
- Reduces concentration risk

**Cons:**
- Ignores conviction levels
- May overweight low-quality names
- Higher turnover (frequent rebalancing)

**Best for:** Passive investors, index-like approaches

### Strategy 2: Conviction Weighting

**Method:** Allocate more to high-conviction ideas, less to lower conviction

**Example Tiers:**
- High conviction: 7-10% positions (5-8 stocks)
- Medium conviction: 4-6% positions (8-12 stocks)
- Low conviction / Satellite: 2-3% positions (5-10 stocks)

**Pros:**
- Reflects analytical edge
- Better risk-adjusted returns if skill exists
- Maintains diversification

**Cons:**
- Requires honest conviction assessment
- Risk of overconfidence
- Can lead to concentration

**Best for:** Active investors with research capability

### Strategy 3: Risk Parity

**Method:** Allocate based on risk contribution, not dollar value

**Example:**
- Volatile stock (beta 1.8): 3% allocation
- Moderate stock (beta 1.0): 5% allocation
- Stable stock (beta 0.6): 8% allocation

**Pros:**
- True diversification of risk
- More stable portfolio performance
- Thoughtful risk management

**Cons:**
- Complex to implement
- Requires volatility estimates
- May overweight low-quality stable stocks

**Best for:** Sophisticated investors, risk-focused approaches

### Strategy 4: Core-Satellite

**Method:**
- **Core (60-80%):** Diversified, low-cost index funds
- **Satellite (20-40%):** High-conviction individual stocks or sector bets

**Pros:**
- Combines passive diversification with active upside
- Reduces risk of stock-picking errors
- Cost-efficient

**Cons:**
- Performance depends on satellite selection
- Complexity in management
- Tax efficiency varies

**Best for:** Investors who want both diversification and active involvement

## Diversification Quality Checklist

Use this checklist to assess portfolio diversification:

**Position Diversification:**
- [ ] Portfolio has 15-30 stocks (or 5-10 diversified funds)
- [ ] No single position exceeds 10% of portfolio
- [ ] No single position exceeds 15% of portfolio
- [ ] Top 5 positions represent less than 40% of portfolio
- [ ] HHI score below 1800

**Sector Diversification:**
- [ ] No single sector exceeds 30% of equity allocation
- [ ] Portfolio includes at least 6 different sectors
- [ ] Sector weights reasonably close to benchmark (within 15%)
- [ ] Balance between growth, defensive, and cyclical sectors
- [ ] No overconcentration in single industry (e.g., semiconductors within tech)

**Correlation Diversification:**
- [ ] Holdings span multiple industries with different drivers
- [ ] Average pairwise correlation estimated below 0.6
- [ ] Not all positions are high-beta growth stocks
- [ ] Includes mix of cyclical and defensive names
- [ ] Some low-correlation positions included (staples, utilities, healthcare)

**Geographic Diversification:**
- [ ] International exposure present (15-30% of equities)
- [ ] Not 100% dependent on US economic performance
- [ ] Emerging market exposure if appropriate for risk tolerance
- [ ] Consider revenue geography, not just listing location

**Market Cap Diversification:**
- [ ] Mix of large-cap, mid-cap, and potentially small-cap
- [ ] Not exclusively mega-caps (>$500B)
- [ ] Not exclusively small-caps (<$2B)
- [ ] Weighted average market cap appropriate for risk tolerance

**Asset Class Diversification:**
- [ ] Equity allocation matches risk tolerance
- [ ] Fixed income present (unless very aggressive allocation)
- [ ] Cash buffer for opportunities and liquidity
- [ ] Alternative assets if appropriate (real estate, commodities)

## Common Diversification Mistakes

### Mistake 1: False Diversification

**Problem:** Holding many stocks that are highly correlated

**Example:**
- Portfolio: AAPL, MSFT, GOOGL, AMZN, META, NVDA, TSLA (all large-cap tech/growth)
- **Appears** diversified (7 stocks)
- **Actually** highly concentrated (single sector, similar risk factors)

**Solution:** Diversify across sectors, not just number of names

### Mistake 2: Over-Diversification ("Diworsification")

**Problem:** Holding too many positions, diluting returns with no additional risk reduction

**Example:**
- 100 individual stock positions
- Overlap with index funds
- Closet indexing with higher fees

**Solution:** Stick to 15-30 best ideas OR use low-cost index funds

### Mistake 3: Home Country Bias

**Problem:** Overweighting domestic stocks, missing global opportunities

**Example:**
- US investor with 95% US stocks
- US represents ~60% of global market cap
- Missing international diversification benefit

**Solution:** Allocate 15-30% to international equities

### Mistake 4: Employer Stock Concentration

**Problem:** Large position in employer stock creates correlated life risks

**Example:**
- 40% of portfolio in employer stock
- Job + portfolio both dependent on same company
- "Double jeopardy" if company struggles

**Solution:** Trim to <10% of portfolio, diversify proceeds

### Mistake 5: Sector Drift

**Problem:** Letting winners run creates unintended sector concentration

**Example:**
- Tech stocks appreciate 200%, now 50% of portfolio
- Investor didn't actively overweight tech, just didn't rebalance
- Concentrated risk without conviction

**Solution:** Regular rebalancing to maintain diversification

### Mistake 6: Forgetting About Bonds

**Problem:** 100% equities for investors who can't handle volatility

**Example:**
- Aggressive investor holds all stocks
- Market drops 30%, investor panics and sells at bottom
- Would have been better with 70/30 stock/bond mix

**Solution:** Match allocation to risk tolerance and time horizon

### Mistake 7: Low-Quality Diversification

**Problem:** Adding poor-quality stocks just to increase position count

**Example:**
- Has 20 quality stocks, adds 10 speculative names to "diversify"
- Speculative names drag down returns without meaningfully reducing risk
- Quality dilution

**Solution:** Diversify within quality standards, don't lower bar for diversification

## Advanced Topics

### Factor-Based Diversification

Beyond traditional diversification, consider factor exposures:

**Common Factors:**
- **Value:** Low P/E, P/B stocks
- **Growth:** High revenue/earnings growth
- **Momentum:** Recent price performance
- **Quality:** High ROE, stable earnings
- **Low Volatility:** Low beta, stable returns
- **Size:** Small cap vs large cap

**Factor Diversification:**
- Avoid loading entirely on one factor (e.g., all momentum stocks)
- Balance factor exposures or tilt deliberately
- Recognize factor cycles (value outperforms in some periods, growth in others)

### Tail Risk and Black Swans

**Problem:** Normal diversification fails in extreme events

**2008 Financial Crisis Example:**
- Stocks fell 50%+
- Most correlations approached 1.0
- Traditional diversification provided limited protection

**Solutions:**
- **Include uncorrelated assets:** Gold, long-volatility strategies, managed futures
- **Tail hedges:** Put options, VIX calls (expensive, insurance-like)
- **Portfolio construction:** Barbell approach (safe core + aggressive satellites)

### Dynamic Diversification

**Concept:** Adjust diversification based on market conditions

**High Volatility Regimes:**
- Increase diversification (more positions, lower concentration)
- Add defensive positions
- Reduce correlation among holdings

**Low Volatility Regimes:**
- Can handle slightly higher concentration
- Focus on highest conviction ideas
- Accept higher correlation

**Implementation Challenge:** Requires market regime detection and discipline

## Summary

**Key Principles:**

1. **Diversification reduces unsystematic risk** without eliminating systematic risk
2. **Optimal range:** 15-30 individual stocks OR 5-10 diversified funds
3. **Multi-dimensional approach:** Number, weight, sector, geography, correlation
4. **Avoid false diversification:** Many holdings with high correlation
5. **Avoid over-diversification:** Too many positions dilute returns
6. **Regular rebalancing** prevents concentration drift
7. **Match to risk tolerance:** More diversification for lower risk tolerance

**Practical Guidelines:**

- No single stock >10-15%
- No single sector >30-35%
- Top 5 holdings <40% of portfolio
- 6+ sectors represented
- International exposure 15-30%
- Asset allocation matches time horizon and risk tolerance

**Remember:** Diversification is about risk management, not return maximization. A well-diversified portfolio sacrifices some upside potential to protect against catastrophic losses. The goal is to "stay in the game" through all market conditions.


path: references/portfolio-risk-metrics.md
content: # Portfolio Risk Metrics

This document provides comprehensive guidance on measuring and interpreting portfolio risk using standard financial metrics.

## Overview

Portfolio risk assessment requires both quantitative metrics and qualitative judgment. This guide covers:

1. Volatility-based metrics (standard deviation, beta)
2. Downside risk measures (maximum drawdown, semi-deviation)
3. Risk-adjusted return metrics (Sharpe ratio, Sortino ratio)
4. Concentration and correlation metrics
5. Interpretation frameworks for different investor types

## Volatility Metrics

### Standard Deviation (σ)

**Definition:** Measure of how much returns vary from the average return over time.

**Formula:**
```
σ = √[Σ(R_i - R_avg)² / (n-1)]

Where:
R_i = Return in period i
R_avg = Average return
n = Number of periods
```

**Interpretation:**

| Annual Std Dev | Risk Level | Typical Assets |
|---------------|------------|----------------|
| **<5%** | Very Low | Cash, short-term bonds |
| **5-10%** | Low | Bond portfolios, conservative balanced |
| **10-15%** | Moderate | Balanced portfolios (60/40), dividend stocks |
| **15-20%** | High | Stock portfolios, growth stocks |
| **>20%** | Very High | Small caps, emerging markets, sector funds |

**S&P 500 Historical:** ~15-18% annualized standard deviation

**Usage in Portfolio Analysis:**
- Compare portfolio volatility to benchmarks
- Assess if volatility matches investor risk tolerance
- Track changes in volatility over time (increasing volatility = warning sign)

**Limitations:**
- Assumes normal distribution (actual returns have "fat tails")
- Treats upside and downside volatility equally
- Based on historical data (may not predict future)

### Beta (β)

**Definition:** Measure of portfolio sensitivity to market movements.

**Formula:**
```
β = Cov(R_portfolio, R_market) / Var(R_market)

Or estimated as:
β = (Σw_i × β_i)

Where:
w_i = Weight of position i
β_i = Beta of position i
```

**Interpretation:**

| Beta | Market Sensitivity | Portfolio Behavior |
|------|-------------------|-------------------|
| **β < 0.5** | Very low | Defensive, low correlation to market |
| **β = 0.5-0.8** | Low | Below-market volatility, defensive tilt |
| **β = 0.8-1.0** | Moderate | Slightly less volatile than market |
| **β = 1.0** | Market | Moves in line with market (index-like) |
| **β = 1.0-1.3** | Moderate-high | More volatile than market |
| **β = 1.3-1.6** | High | Significantly more volatile |
| **β > 1.6** | Very high | Extremely volatile, aggressive |

**Typical Security Betas:**
- Utilities: 0.4-0.7
- Consumer Staples: 0.5-0.8
- Healthcare: 0.8-1.1
- S&P 500 Index: 1.0
- Technology: 1.1-1.5
- Small-cap growth: 1.3-2.0
- Leveraged ETFs: 2.0-3.0

**Example Portfolio Beta Calculation:**

Portfolio:
- 40% SPY (S&P 500 ETF, β=1.0): 0.40 × 1.0 = 0.40
- 30% QQQ (Nasdaq ETF, β=1.2): 0.30 × 1.2 = 0.36
- 20% VNQ (REIT ETF, β=0.9): 0.20 × 0.9 = 0.18
- 10% TLT (Bond ETF, β=0.3): 0.10 × 0.3 = 0.03

**Portfolio Beta** = 0.40 + 0.36 + 0.18 + 0.03 = **0.97**

**Interpretation:** Portfolio expected to move 97% as much as the market (slightly defensive).

**Usage:**
- Assess portfolio aggressiveness
- Predict portfolio behavior in market moves (β=1.2 means 12% drop when market drops 10%)
- Identify need for hedging or rebalancing

**Limitations:**
- Beta changes over time
- Based on historical correlations
- May not hold in extreme markets

### Semi-Deviation

**Definition:** Standard deviation of returns below the mean (focuses on downside volatility only).

**Formula:**
```
Semi-deviation = √[Σ(R_i - R_avg)² for all R_i < R_avg / n]
```

**Interpretation:**
- Lower semi-deviation = better downside protection
- Useful for risk-averse investors who care more about losses than gains
- Typically 60-70% of standard deviation for symmetric distributions

**Usage:**
- Evaluate downside risk specifically
- Compare defensive vs aggressive strategies
- Input for Sortino ratio (risk-adjusted return metric)

## Downside Risk Metrics

### Maximum Drawdown (MDD)

**Definition:** Largest peak-to-trough decline in portfolio value over a specific period.

**Formula:**
```
MDD = (Trough Value - Peak Value) / Peak Value

Or: MDD = max[(P_peak - P_trough) / P_peak] over all peaks
```

**Example:**
- Portfolio peak: $150,000 (March 2020)
- Portfolio trough: $105,000 (March 2020 crash)
- MDD = ($105k - $150k) / $150k = **-30%**

**Historical Maximum Drawdowns:**

| Asset/Portfolio | Max Drawdown | Period |
|----------------|--------------|--------|
| S&P 500 | -57% | 2007-2009 (Financial Crisis) |
| S&P 500 | -34% | 2020 (COVID Crash) |
| Nasdaq 100 | -83% | 2000-2002 (Tech Bubble) |
| Nasdaq 100 | -32% | 2021-2022 (Rate Hikes) |
| 60/40 Portfolio | -32% | 2007-2009 |
| Treasury Bonds | -48% | 2020-2023 (Rising Rates) |

**Risk Tolerance Guide:**

| Investor Type | Max Acceptable Drawdown |
|--------------|------------------------|
| **Conservative** | -10 to -15% |
| **Moderate** | -15 to -25% |
| **Growth** | -25 to -35% |
| **Aggressive** | -35 to -50% |

**Usage:**
- Assess worst-case historical scenario
- Compare to investor risk tolerance
- Set risk management triggers (e.g., hedge if drawdown >20%)
- Estimate recovery time needed

**Recovery Time:**
- 20% drawdown requires +25% gain to recover
- 30% drawdown requires +43% gain
- 50% drawdown requires +100% gain (doubling)

### Current Drawdown

**Definition:** Decline from most recent peak to current value.

**Formula:**
```
Current Drawdown = (Current Value - Recent Peak Value) / Recent Peak Value
```

**Example:**
- Recent peak: $150,000 (last month)
- Current value: $142,500
- Current drawdown = ($142.5k - $150k) / $150k = **-5%**

**Interpretation:**

| Current Drawdown | Status | Action |
|-----------------|--------|--------|
| **0%** | At all-time high | Monitor for complacency |
| **-1% to -5%** | Minor pullback | Normal, no action |
| **-5% to -10%** | Moderate correction | Review positions, monitor |
| **-10% to -20%** | Correction | Assess portfolio, consider adjustments |
| **>-20%** | Bear market territory | Review allocation, consider rebalancing |

**Usage:**
- Real-time risk monitoring
- Identify when portfolio is under stress
- Trigger rebalancing or risk reduction

### Value at Risk (VaR)

**Definition:** Maximum expected loss over a given time period at a given confidence level.

**Example:**
- 1-month VaR at 95% confidence = $10,000
- **Interpretation:** 95% confident that portfolio will not lose more than $10,000 in the next month (or: 5% chance of losing more than $10,000)

**Calculation Methods:**

1. **Historical VaR:** Use historical return distribution
2. **Parametric VaR:** Assume normal distribution, use mean and std dev
3. **Monte Carlo VaR:** Simulate thousands of scenarios

**Simplified Parametric VaR Formula:**
```
VaR = Portfolio Value × (z-score × σ - μ)

Where:
z-score = 1.65 for 95% confidence, 2.33 for 99% confidence
σ = Portfolio standard deviation (daily or monthly)
μ = Expected return (daily or monthly)
```

**Example Calculation:**
- Portfolio value: $100,000
- Annual std dev: 18%
- Monthly std dev: 18% / √12 = 5.2%
- Expected monthly return: 0.5%

**95% 1-month VaR:**
```
VaR = $100,000 × (1.65 × 5.2% - 0.5%)
    = $100,000 × (8.58% - 0.5%)
    = $100,000 × 8.08%
    = $8,080
```

**Interpretation:** 95% confident that portfolio will not lose more than $8,080 in the next month.

**Usage:**
- Risk budgeting
- Setting position limits
- Regulatory compliance (for institutions)

**Limitations:**
- Assumes historical patterns continue
- Underestimates tail risk (extreme events)
- Doesn't tell you about losses beyond VaR threshold

## Risk-Adjusted Return Metrics

### Sharpe Ratio

**Definition:** Excess return per unit of risk (reward-to-variability ratio).

**Formula:**
```
Sharpe Ratio = (R_portfolio - R_f) / σ_portfolio

Where:
R_portfolio = Portfolio return (annualized)
R_f = Risk-free rate (typically 10-year Treasury)
σ_portfolio = Portfolio standard deviation (annualized)
```

**Example Calculation:**
- Portfolio return: 12%
- Risk-free rate: 4%
- Portfolio std dev: 15%

**Sharpe = (12% - 4%) / 15% = 8% / 15% = 0.53**

**Interpretation:**

| Sharpe Ratio | Quality | Interpretation |
|--------------|---------|----------------|
| **< 0** | Poor | Return less than risk-free rate |
| **0 - 0.5** | Suboptimal | Low excess return for risk taken |
| **0.5 - 1.0** | Good | Adequate risk-adjusted return |
| **1.0 - 2.0** | Very Good | Strong risk-adjusted return |
| **> 2.0** | Excellent | Exceptional risk-adjusted return |

**Typical Sharpe Ratios:**
- S&P 500 (long-term): 0.3-0.5
- Well-managed equity portfolio: 0.5-0.8
- Exceptional hedge fund: 1.0-1.5
- Market-neutral strategy: 1.5-2.0+

**Usage:**
- Compare different portfolios or strategies
- Assess if additional risk is being compensated
- Benchmark against market (S&P 500 Sharpe)

**Limitations:**
- Penalizes upside volatility equally with downside
- Assumes normal distribution
- Sensitive to time period chosen

### Sortino Ratio

**Definition:** Like Sharpe ratio, but uses downside deviation instead of total volatility.

**Formula:**
```
Sortino Ratio = (R_portfolio - R_f) / Semi-deviation

Where semi-deviation only counts returns below risk-free rate
```

**Example:**
- Portfolio return: 12%
- Risk-free rate: 4%
- Semi-deviation (downside only): 10%

**Sortino = (12% - 4%) / 10% = 0.80**

**Interpretation:**
- Higher Sortino = better downside-adjusted returns
- Sortino typically higher than Sharpe (since semi-deviation < standard deviation)
- Preferred metric for risk-averse investors

**Usage:**
- Evaluate strategies with asymmetric returns (e.g., option strategies)
- Focus on downside protection
- Compare portfolios with different return distributions

### Calmar Ratio

**Definition:** Return relative to maximum drawdown.

**Formula:**
```
Calmar Ratio = Annualized Return / |Max Drawdown|
```

**Example:**
- Annualized return: 10%
- Max drawdown: -25%

**Calmar = 10% / 25% = 0.40**

**Interpretation:**

| Calmar Ratio | Quality |
|--------------|---------|
| **< 0.5** | Poor (high drawdown relative to return) |
| **0.5 - 1.0** | Acceptable |
| **1.0 - 2.0** | Good |
| **> 2.0** | Excellent (low drawdown, high return) |

**Usage:**
- Focus on worst-case scenarios
- Evaluate hedge funds and absolute return strategies
- Assess recovery potential

## Concentration and Correlation Metrics

### Concentration Metrics

**1. Top-N Concentration**

Percentage of portfolio in largest N positions:

```
Top-N % = (Σ Top N Position Values) / Total Portfolio Value
```

**Guidelines:**
- Top 1 position: <10% ideal, <15% maximum
- Top 5 positions: <40% ideal, <50% maximum
- Top 10 positions: <60% ideal, <70% maximum

**2. Herfindahl-Hirschman Index (HHI)**

(See diversification-principles.md for detailed explanation)

```
HHI = Σ(Weight_i × 100)²
```

**Quick Assessment:**
- HHI < 1000: Well-diversified
- HHI 1000-1800: Moderately concentrated
- HHI > 1800: High concentration

### Correlation Metrics

**Average Pairwise Correlation**

Average correlation between all position pairs:

```
Avg Correlation = Σ(ρ_ij) / Number of pairs

Where:
ρ_ij = correlation between positions i and j
Number of pairs = n(n-1)/2 for n positions
```

**Example (5 positions):**
- 10 pairs total
- Sum of correlations: 5.2
- Average: 5.2 / 10 = **0.52**

**Interpretation:**

| Avg Correlation | Diversification Quality |
|----------------|------------------------|
| **< 0.3** | Excellent (low correlation) |
| **0.3 - 0.5** | Good |
| **0.5 - 0.7** | Moderate (typical equity portfolio) |
| **> 0.7** | Poor (positions move together) |

## Risk Scoring Framework

### Composite Risk Score (0-100)

Combine multiple metrics into single score:

**Scoring Formula:**

```
Risk Score =
  (Volatility Score × 30%) +
  (Beta Score × 20%) +
  (Drawdown Score × 25%) +
  (Concentration Score × 25%)
```

**Individual Component Scores (0-100):**

**1. Volatility Score:**
- <10% std dev: 0-20 points (low risk)
- 10-15% std dev: 20-40 points
- 15-20% std dev: 40-60 points
- 20-25% std dev: 60-80 points
- >25% std dev: 80-100 points (very high risk)

**2. Beta Score:**
- β < 0.8: 0-20 points
- β 0.8-1.0: 20-40 points
- β 1.0-1.3: 40-60 points
- β 1.3-1.6: 60-80 points
- β > 1.6: 80-100 points

**3. Drawdown Score:**
- Max DD <10%: 0-20 points
- Max DD 10-20%: 20-40 points
- Max DD 20-30%: 40-60 points
- Max DD 30-40%: 60-80 points
- Max DD >40%: 80-100 points

**4. Concentration Score:**
- HHI <1000: 0-20 points
- HHI 1000-1500: 20-40 points
- HHI 1500-2000: 40-60 points
- HHI 2000-2500: 60-80 points
- HHI >2500: 80-100 points

**Composite Risk Score Interpretation:**

| Score | Risk Level | Appropriate For |
|-------|-----------|-----------------|
| **0-20** | Very Low | Ultra-conservative, retirees |
| **20-40** | Low | Conservative investors |
| **40-60** | Moderate | Balanced investors |
| **60-80** | High | Growth-oriented investors |
| **80-100** | Very High | Aggressive, long time horizon |

## Practical Risk Assessment Workflow

### Step 1: Calculate Basic Metrics

1. **Portfolio Beta** (weighted average of position betas)
2. **Standard Deviation** (if historical data available, else estimate)
3. **Maximum Drawdown** (from portfolio history)
4. **Current Drawdown** (vs recent peak)
5. **Top-5 Concentration** (sum of 5 largest positions)
6. **HHI** (concentration index)

### Step 2: Compare to Benchmarks

**Against S&P 500:**
- Is beta higher or lower than 1.0?
- Is volatility higher or lower than ~16%?

**Against Risk Profile Targets:**
- Does risk level match investor's stated risk tolerance?
- Is maximum drawdown acceptable?

### Step 3: Identify Risk Concentrations

**Position-Level:**
- Any position >15%? → Immediate trim
- Top 5 >50%? → High concentration

**Sector-Level:**
- Any sector >35%? → Concentration risk
- Any sector missing? → Diversification gap

**Factor-Level:**
- All high-beta growth stocks? → Factor concentration
- All value stocks? → Style concentration

### Step 4: Risk-Adjusted Performance

1. **Calculate Sharpe Ratio** (if return history available)
2. **Compare to benchmark:** Is portfolio delivering better risk-adjusted returns?
3. **Calculate Sortino Ratio** for downside focus
4. **Assess if excess risk is being rewarded**

### Step 5: Generate Risk Assessment

**Summary Format:**

```markdown
## Portfolio Risk Assessment

**Overall Risk Profile:** [Conservative / Moderate / Growth / Aggressive]

**Risk Score:** XX/100 ([Low / Medium / High / Very High])

**Key Metrics:**
- Portfolio Beta: X.XX (vs market 1.00)
- Estimated Volatility: XX% annualized
- Maximum Drawdown: -XX% (acceptable for [risk profile])
- Current Drawdown: -X% (vs recent peak)

**Risk Concentrations:**
- Top 5 positions: XX% of portfolio ([OK / High / Excessive])
- Largest single position: [SYMBOL] at XX% ([OK / Trim recommended])
- HHI: XXXX ([Well-diversified / Concentrated])

**Risk-Adjusted Performance:**
- Sharpe Ratio: X.XX ([Below / In-line / Above] market)
- Sortino Ratio: X.XX
- Performance for risk taken: [Excellent / Good / Fair / Poor]

**Risk Recommendations:**
- [List specific actions to reduce risk if needed]
```

## Risk Management Guidelines

### When to Reduce Risk

**Signals:**
- Portfolio beta >1.5 for moderate risk tolerance investor
- Max drawdown exceeds investor's tolerance
- Single position >15% of portfolio
- Sector concentration >40%
- Current drawdown >20% (entering bear market)

**Actions:**
- Trim concentrated positions
- Add defensive sectors (Utilities, Staples, Healthcare)
- Increase bond allocation
- Raise cash levels

### When to Increase Risk

**Signals:**
- Portfolio beta <0.7 for growth-oriented investor
- Cash position >15% (unless intentionally defensive)
- Underperforming benchmark significantly with lower volatility
- Long time horizon with conservative allocation

**Actions:**
- Add growth sectors (Technology, Consumer Discretionary)
- Increase equity allocation
- Deploy excess cash
- Add higher-conviction positions

## Summary

**Key Takeaways:**

1. **Multiple metrics needed:** No single metric tells the full story
2. **Volatility measures:** Standard deviation and beta for overall risk
3. **Downside risk:** Maximum drawdown, current drawdown, VaR for worst-case scenarios
4. **Risk-adjusted returns:** Sharpe and Sortino ratios for performance quality
5. **Concentration:** HHI and top-N positions for diversification assessment
6. **Match to investor:** Risk metrics must align with risk tolerance and goals
7. **Monitor continuously:** Risk characteristics change as markets move

**Practical Application:**

- Calculate key metrics quarterly
- Compare to investor risk tolerance
- Identify concentrations and gaps
- Adjust allocation to maintain target risk level
- Document risk assessment in portfolio reports

**Remember:** Risk metrics are tools, not absolute truth. Use judgment and consider qualitative factors (market environment, economic outlook, investor circumstances) alongside quantitative metrics.


path: references/position-evaluation.md
content: # Position Evaluation Framework

This document provides a systematic framework for evaluating individual positions within a portfolio to determine appropriate actions: HOLD, ADD, TRIM, or SELL.

## Overview

Position evaluation requires both quantitative analysis and qualitative judgment. This framework helps answer:

1. Is the original investment thesis still intact?
2. Is the position appropriately sized given current conviction and risk?
3. Has the valuation become stretched or attractive?
4. What is the expected forward return vs risk?
5. Are there better opportunities elsewhere?

## Four-Factor Evaluation Model

Every position should be evaluated across four dimensions:

### 1. Thesis Validation (40% weight)
- Is the investment thesis playing out as expected?
- Have fundamentals improved, remained stable, or deteriorated?
- Are growth prospects intact or changed?

### 2. Valuation Assessment (30% weight)
- Is the stock overvalued, fairly valued, or undervalued?
- How does current valuation compare to historical range?
- How does it compare to peer group?

### 3. Position Sizing (20% weight)
- Is current position size appropriate?
- Does it match conviction level?
- Is it creating concentration risk?

### 4. Relative Opportunity (10% weight)
- Are there better uses of capital?
- Would selling this improve portfolio?
- Cost of holding vs deploying elsewhere

## Detailed Evaluation Framework

### Thesis Validation Analysis

**Original Thesis Documentation:**

For each position, document the original investment thesis:

**Example Thesis Template:**
```
Symbol: AAPL
Initial Thesis (Date: Jan 2023):
- Services revenue growing 15%+ annually
- Installed base expansion (1.8B → 2.0B devices)
- Margin expansion from services mix shift
- Capital return program (dividends + buybacks)
- Valuation: P/E 24x vs historical 18x, justified by services growth

Entry Price: $145
Target Price: $180 (12-month)
Expected Return: 24% (+2% dividend = 26% total)
Risk Factors: iPhone demand slowdown, China regulatory risk
```

**Thesis Validation Checklist:**

- [ ] **Revenue/Earnings Growth:** On track vs expectations?
  - Expected: +15% revenue growth
  - Actual: +12% (slightly below, acceptable / -5% (concerning))

- [ ] **Margins:** Improving, stable, or declining?
  - Expected: Expanding by 100bps
  - Actual: Expanded 80bps (close enough / Contracted 50bps (negative))

- [ ] **Competitive Position:** Strengthening or weakening?
  - Market share trends
  - New product success/failures
  - Competitor actions

- [ ] **Management Execution:** Meeting targets?
  - Guidance met/beaten/missed
  - Capital allocation decisions
  - Strategic pivots if any

- [ ] **Industry Tailwinds:** Still present?
  - Secular trends intact?
  - Regulatory changes
  - Technology shifts

**Thesis Status Classification:**

| Status | Criteria | Action Bias |
|--------|----------|-------------|
| **Strengthening** | Fundamentals improving, thesis accelerating | Consider ADD |
| **Intact** | On track with expectations, no changes | HOLD |
| **Weakening** | Some concerns, thesis partially impaired | Consider TRIM |
| **Broken** | Thesis invalid, fundamentals deteriorating | SELL |

### Valuation Assessment

**Valuation Methodology:**

Compare current valuation across multiple dimensions:

**1. Historical Valuation Range**

| Metric | Current | 1Y Avg | 3Y Avg | 5Y Avg | Min | Max |
|--------|---------|--------|--------|--------|-----|-----|
| P/E | 28x | 25x | 22x | 20x | 12x | 35x |
| P/B | 6.5x | 5.8x | 5.2x | 4.8x | 3.5x | 8.0x |
| EV/EBITDA | 22x | 19x | 17x | 16x | 10x | 25x |
| Div Yield | 1.2% | 1.4% | 1.6% | 1.8% | 0.8% | 2.5% |

**Analysis:**
- Current P/E (28x) near 3Y max (35x) → Expensive vs history
- P/B elevated vs 5Y avg → Premium valuation
- Dividend yield low vs range → Not a value play

**2. Peer Group Comparison**

| Company | P/E | P/B | EV/EBITDA | Dividend Yield | Rev Growth | Margin |
|---------|-----|-----|-----------|----------------|------------|--------|
| **[Target]** | 28x | 6.5x | 22x | 1.2% | 12% | 28% |
| Peer A | 22x | 4.2x | 18x | 1.8% | 8% | 22% |
| Peer B | 31x | 7.8x | 25x | 0.9% | 18% | 32% |
| Peer C | 25x | 5.1x | 20x | 1.5% | 10% | 25% |
| **Sector Median** | 25x | 5.5x | 20x | 1.4% | 11% | 26% |

**Analysis:**
- P/E slightly above sector median → Modest premium
- Growth (12%) above median (11%) → Premium partially justified
- Margins (28%) above median (26%) → Quality justifies some premium
- **Assessment:** Fair to slightly expensive vs peers

**3. Growth-Adjusted Valuation (PEG Ratio)**

```
PEG Ratio = P/E / Earnings Growth Rate

Example:
P/E: 28x
Expected EPS growth: 15%
PEG = 28 / 15 = 1.87

Interpretation:
< 1.0 = Undervalued
1.0-2.0 = Fair value
> 2.0 = Overvalued
```

**4. DCF Fair Value Estimate (Simplified)**

If time permits, estimate intrinsic value using discounted cash flow:

```
Fair Value = (FCF × (1 + growth rate)^5) / (discount rate - terminal growth)

Example inputs:
Current FCF: $100B
Growth (5Y): 12%
Discount rate: 10%
Terminal growth: 4%
```

**Valuation Status Classification:**

| Status | Criteria | Action Bias |
|--------|----------|-------------|
| **Undervalued** | Below historical avg, below peers, low PEG | ADD |
| **Fair Value** | In-line with history and peers | HOLD |
| **Overvalued** | Above historical range, premium to peers, high PEG | TRIM |
| **Severely Overvalued** | Extreme multiples, bubble-like | SELL |

### Position Sizing Analysis

**Current Position Assessment:**

```
Position Size = Position Value / Total Portfolio Value

Example:
Position value: $18,000
Portfolio value: $120,000
Position size: 18,000 / 120,000 = 15%
```

**Position Sizing Guidelines:**

| Conviction Level | Target Position Size | Max Position Size |
|------------------|---------------------|-------------------|
| **High Conviction** | 8-12% | 15% |
| **Medium Conviction** | 5-8% | 10% |
| **Low Conviction / Speculative** | 2-5% | 7% |
| **Starter Position** | 2-3% | 5% |

**Position Sizing Risk Assessment:**

| Current Size | Risk Level | Typical Action |
|--------------|-----------|----------------|
| **<5%** | Low | Can add if conviction high |
| **5-10%** | Normal | Monitor |
| **10-15%** | Elevated | Trim if conviction not very high |
| **15-20%** | High | Trim recommended |
| **>20%** | Excessive | Urgent trim required |

**Position Drift Analysis:**

Track how position size has changed due to price appreciation:

```
Position Appreciation Impact:

Initial investment: $10,000 (10% of $100K portfolio)
Other holdings flat, this position doubled
Current value: $20,000 (18% of $110K portfolio)

Position drift: 10% → 18% (increased 8 percentage points)
Exceeded target: Yes (assuming 10% target)
Action: Trim back to 10-12% range
```

**Rebalancing Calculation:**

```
To trim from 18% to 10%:

Target value: $110,000 × 10% = $11,000
Current value: $20,000
Amount to sell: $20,000 - $11,000 = $9,000
Shares to sell: $9,000 / Current Price
```

### Relative Opportunity Analysis

**Opportunity Cost Framework:**

Ask: "If I sold this position today, where would I deploy the capital?"

**Comparison Matrix:**

| Option | Expected Return | Risk Level | Conviction | Notes |
|--------|----------------|------------|-----------|-------|
| **Hold [Current]** | 8% | Medium | Medium | Fairly valued, thesis intact |
| Alternative A | 15% | High | High | Undervalued, strong thesis |
| Alternative B | 10% | Low | Medium | Defensive, lower risk |
| Cash (wait) | 4% | None | N/A | Opportunity cost |

**Decision Logic:**

If (Alternative Expected Return - Hold Expected Return) > Switching Cost:
→ Consider selling current, buying alternative

**Switching Costs to Consider:**
- **Taxes:** Capital gains (15-20% long-term, ordinary income short-term)
- **Transaction costs:** Commissions (minimal) + bid-ask spread
- **Opportunity risk:** Wrong about alternative, miss rebound in current

**Example Calculation:**

```
Current position: Expected 8% return
Alternative: Expected 15% return
Differential: 7%

Unrealized gain: $8,000 on $20,000 position (67% gain)
Tax on sale (20% long-term): $8,000 × 0.20 = $1,600
After-tax proceeds: $20,000 - $1,600 = $18,400

After-tax opportunity gain (1 year):
Hold current: $20,000 × 1.08 = $21,600
Buy alternative: $18,400 × 1.15 = $21,160

Conclusion: Tax drag eliminates benefit for 1-year hold
Consider if: (1) Multi-year horizon, or (2) Tax-advantaged account, or (3) Can tax-loss harvest elsewhere
```

## Position Action Decision Matrix

Combine the four factors to determine action:

### HOLD Decision

**Criteria:**
- ✅ Thesis: Intact or strengthening
- ✅ Valuation: Fair to undervalued
- ✅ Position Size: Within target range (5-10% for medium conviction)
- ✅ Relative Opportunity: No clearly better alternative after costs

**Example:**
```
Position: Johnson & Johnson (JNJ)
Thesis: ✅ Intact (healthcare demand, dividend aristocrat)
Valuation: ✅ Fair (P/E 16x vs 15x historical avg)
Position Size: ✅ 7% of portfolio (target range)
Opportunity: ✅ No compelling alternative in healthcare

Decision: HOLD
Rationale: Position performing as expected, appropriately sized, no reason to change
Next Review: Quarterly earnings (Q3 2024)
```

### ADD Decision

**Criteria:**
- ✅ Thesis: Strengthening or intact with high conviction
- ✅ Valuation: Undervalued or fair with improving fundamentals
- ✅ Position Size: Below target, room to add without excessive concentration
- ✅ Opportunity: Among top ideas, better than alternatives

**Example:**
```
Position: Meta Platforms (META)
Thesis: ✅ Strengthening (AI monetization exceeding expectations, cost discipline)
Valuation: ✅ Undervalued (P/E 22x vs 28x historical, PEG 1.2)
Position Size: ✅ 5% of portfolio (room to add to 8-10%)
Opportunity: ✅ Top conviction, better expected return than alternatives

Decision: ADD 3-5% more (increase position to 8-10% total)
Rationale: Thesis improving, valuation attractive, high conviction
Entry Strategy: Add 3% now, 2% more if pullback to $450 support
Risk Management: Set stop-loss at $420 (recent low)
```

### TRIM Decision

**Criteria:**
- ⚠️ Thesis: Weakening OR still intact but lower conviction
- ⚠️ Valuation: Overvalued or expensive vs historical/peers
- ⚠️ Position Size: Exceeded target (>12% for medium conviction, >15% for high conviction)
- ⚠️ Opportunity: Better alternatives available or risk reduction needed

**Example:**
```
Position: NVIDIA (NVDA)
Thesis: ✅ Intact (AI demand strong) ⚠️ but slowing growth rates expected
Valuation: ⚠️ Expensive (P/E 65x vs 45x historical, extended vs peers)
Position Size: ⚠️ 18% of portfolio (exceeded 15% max)
Opportunity: ⚠️ Other high-quality tech at better valuations

Decision: TRIM from 18% to 10-12%
Rationale: Valuation extended, position too large, take some profits
Trim Strategy: Sell 6% now, consider selling another 2% if rallies above $950
Redeployment: Add to underweight healthcare and financials sectors
Tax Strategy: Sell highest-cost-basis shares first (minimize tax impact)
```

### SELL Decision

**Criteria:**
- ❌ Thesis: Broken or significantly impaired
- OR: Valuation severely overvalued with deteriorating fundamentals
- OR: Better opportunities + need to reduce position count
- OR: Risk management (stop-loss triggered, risk too high)

**Example:**
```
Position: Teladoc (TDOC)
Thesis: ❌ Broken (telehealth adoption slower than expected, competition intense, path to profitability unclear)
Valuation: ❌ Expensive vs peers despite losses (EV/Sales 2.5x vs 1.2x sector)
Position Size: ⚠️ 4% of portfolio (not excessive, but capital can be better deployed)
Opportunity: ❌ Multiple better healthcare alternatives (UNH, ELW, CVS)

Decision: SELL (exit position entirely)
Rationale: Investment thesis has not materialized, competitive position weakening, capital better deployed elsewhere
Exit Strategy: Sell entire position over 2-3 days (avoid moving market)
Redeployment: Reallocate to UnitedHealth Group (stronger healthcare thesis)
Tax Benefit: Harvest $2,000 capital loss to offset gains
Lesson Learned: Avoid unprofitable growth stocks in competitive industries
```

## Position Review Checklist

Use this checklist when reviewing each position:

### Fundamental Review
- [ ] Read recent earnings report and call transcript
- [ ] Review updated financial metrics (revenue, margins, EPS)
- [ ] Check for guidance changes (raised, lowered, maintained)
- [ ] Read recent analyst reports or news
- [ ] Verify competitive position (market share, new entrants)

### Valuation Review
- [ ] Calculate current P/E, P/B, EV/EBITDA
- [ ] Compare to 1Y, 3Y, 5Y historical averages
- [ ] Compare to peer group
- [ ] Calculate PEG ratio
- [ ] Assess if valuation justified by fundamentals

### Portfolio Fit Review
- [ ] Calculate current position size (% of portfolio)
- [ ] Assess if size matches conviction
- [ ] Check if position contributes to concentration risk
- [ ] Verify sector allocation impact
- [ ] Evaluate correlation with other holdings

### Risk Review
- [ ] Identify new risks (regulatory, competitive, macro)
- [ ] Assess if stop-loss should be updated
- [ ] Review downside scenario (what could go wrong?)
- [ ] Check beta and volatility (has it increased?)
- [ ] Evaluate if risk/reward still favorable

### Action Decision
- [ ] Does thesis warrant HOLD/ADD/TRIM/SELL?
- [ ] If change needed, what is specific action?
- [ ] What is timeline for action (immediate, gradual, wait for level)?
- [ ] What are trigger points for future action?
- [ ] Document decision and rationale

## Common Position Evaluation Mistakes

### Mistake 1: Anchoring to Purchase Price

**Problem:** "I bought at $100, now it's $80, I'll wait to break even before selling"

**Why wrong:** Purchase price is irrelevant to forward returns. Sunk cost fallacy.

**Correct approach:** Evaluate position based on current fundamentals and forward outlook. If thesis broken, sell now regardless of gain/loss.

### Mistake 2: Letting Winners Run Indefinitely

**Problem:** "It's my best performer, I'll never sell!"

**Why wrong:** Position becomes oversized, creates concentration risk, valuation may become stretched.

**Correct approach:** Trim winners back to target weight periodically. Take some profits. Reinvest in undervalued areas.

### Mistake 3: Selling Losers Too Quickly

**Problem:** "It's down 15%, I need to cut losses"

**Why wrong:** Volatility is normal. Selling in panic often locks in losses before recovery.

**Correct approach:** Evaluate if thesis still intact. If yes, consider adding (averaging down). If no, sell regardless of loss size.

### Mistake 4: Ignoring Valuation ("Quality at Any Price")

**Problem:** "This is a great company, valuation doesn't matter"

**Why wrong:** Even great companies can be overvalued. Future returns depend on entry price.

**Correct approach:** Great companies at fair prices. Trim when expensive, add when cheap, even for high-quality names.

### Mistake 5: Falling in Love with Stocks

**Problem:** Emotional attachment prevents objective evaluation

**Why wrong:** Stocks don't love you back. Capital allocation should be ruthlessly rational.

**Correct approach:** Treat positions as capital deployment decisions, not relationships. Be willing to sell anything if better opportunity exists.

## Summary

**Position Evaluation Framework:**

1. **Thesis Validation (40%)** - Is the story still true?
2. **Valuation Assessment (30%)** - Is the price right?
3. **Position Sizing (20%)** - Is the size appropriate?
4. **Relative Opportunity (10%)** - Are there better uses of capital?

**Four Actions:**

- **HOLD:** Thesis intact, fair valuation, appropriate size
- **ADD:** Strengthening thesis, undervalued, room to add
- **TRIM:** Weakening thesis OR expensive OR oversized
- **SELL:** Broken thesis OR severely overvalued OR much better alternatives

**Best Practices:**

- Review positions quarterly (at minimum)
- Document thesis at purchase
- Update thesis as new information emerges
- Be willing to admit mistakes early
- Trim winners to maintain diversification
- Average down only if thesis intact
- Ignore purchase price (sunk cost)
- Remain objective and unemotional

**Remember:** Position evaluation is both art and science. Combine quantitative metrics with qualitative judgment. When in doubt, reduce position size rather than holding full position or selling entirely.


path: references/rebalancing-strategies.md
content: # Rebalancing Strategies

This document provides comprehensive guidance on portfolio rebalancing methodologies, timing strategies, tax optimization, and implementation best practices.

## What is Rebalancing?

**Definition:** Rebalancing is the process of realigning portfolio weights back to target allocation by buying and selling assets.

**Purpose:**
1. **Maintain target risk level** - Prevent portfolio from becoming too aggressive or conservative
2. **Enforce discipline** - "Buy low, sell high" systematically
3. **Control concentration** - Prevent winners from creating excessive risk
4. **Optimize diversification** - Maintain intended asset allocation benefits

**Example of Portfolio Drift:**

```
Initial Allocation (Jan 2023):
Stocks: 60% ($60,000)
Bonds: 40% ($40,000)
Total: $100,000

After 1 Year (No Rebalancing):
Stocks: +20% → $72,000 (now 69% of portfolio)
Bonds: +2% → $40,800 (now 31% of portfolio)
Total: $112,800

Result: Portfolio is now riskier than intended (69/31 vs 60/40 target)
```

## Rebalancing Methodologies

### 1. Calendar-Based Rebalancing

**Method:** Rebalance on a fixed schedule regardless of market conditions.

**Common Frequencies:**
- **Monthly:** Very frequent, high transaction costs, rarely needed
- **Quarterly:** Popular for active investors, balances responsiveness with costs
- **Semi-Annually:** Good middle ground, aligns with tax planning
- **Annually:** Simplest, lowest cost, sufficient for buy-and-hold investors

**Pros:**
- Simple and predictable
- Prevents procrastination
- Emotionally easier (mechanical process)
- Can align with tax planning (year-end)

**Cons:**
- May rebalance when not needed (small drifts)
- May not rebalance when urgently needed (between scheduled dates)
- Higher transaction costs if frequent
- Potential tax inefficiency

**Best For:**
- Passive investors
- Tax-advantaged accounts (no tax impact)
- Investors who want simplicity

**Implementation:**
```
Set calendar reminder: Q1 (January), Q2 (April), Q3 (July), Q4 (October)

At each date:
1. Calculate current allocation percentages
2. Compare to target allocation
3. If drift > 5%, rebalance
4. If drift < 5%, skip rebalancing
```

### 2. Threshold-Based Rebalancing

**Method:** Rebalance only when allocation drifts beyond specified threshold.

**Common Thresholds:**
- **Absolute threshold:** Asset class deviates >5 percentage points from target
  - Example: Target 60% stocks, rebalance if <55% or >65%
- **Relative threshold:** Asset class deviates >10-20% from target weight
  - Example: Target 60% stocks, rebalance if <54% (60% × 0.9) or >66% (60% × 1.1)

**Pros:**
- Responsive to market volatility
- Rebalances only when necessary
- Lower transaction costs than calendar-based
- Tax-efficient (fewer trades)

**Cons:**
- Requires monitoring
- Can be psychologically harder (rebalancing during extremes)
- May not rebalance in low-volatility periods (not necessarily bad)

**Best For:**
- Active investors who monitor regularly
- Taxable accounts (minimize turnover)
- Volatile portfolios

**Implementation:**
```
Check allocation monthly or quarterly

Rebalance triggers:
- Stocks: Target 60% ± 5% (rebalance if <55% or >65%)
- Bonds: Target 40% ± 5% (rebalance if <35% or >45%)

Single position triggers:
- Any position >15% → Immediate rebalance
- Any sector >35% → Immediate rebalance
```

### 3. Hybrid Approach (Recommended)

**Method:** Combine calendar and threshold - check on schedule, rebalance only if threshold exceeded.

**Implementation:**
```
Check allocation: Quarterly (Jan, Apr, Jul, Oct)
Rebalance only if: Drift > 5% from target

Example:
Q1 Review: Stocks 62% (target 60%) → Drift 2% → No action
Q2 Review: Stocks 67% (target 60%) → Drift 7% → Rebalance
Q3 Review: Stocks 59% (target 60%) → Drift 1% → No action
Q4 Review: Stocks 71% (target 60%) → Drift 11% → Rebalance
```

**Pros:**
- Best of both worlds
- Disciplined review schedule
- Cost-efficient execution
- Balances responsiveness and simplicity

**Cons:**
- Slightly more complex

**Best For:**
- Most investors
- Both taxable and tax-advantaged accounts

### 4. Cash Flow Rebalancing

**Method:** Use new contributions and withdrawals to rebalance rather than selling.

**Implementation:**
```
Every contribution (monthly, quarterly):
1. Identify underweight asset classes
2. Direct new money to underweight areas
3. Over time, allocation drifts back to target

Example:
Monthly contribution: $1,000
Current allocation: Stocks 67%, Bonds 33% (Target 60/40)
Action: Contribute 100% to bonds until allocation normalizes
```

**Pros:**
- Tax-efficient (no selling, no capital gains)
- No transaction costs
- Psychologically easier (always buying)
- Dollar-cost averaging benefit

**Cons:**
- Slow rebalancing (may take months/years)
- Requires regular contributions
- May not work for large drifts
- Not applicable for retired investors (withdrawing, not contributing)

**Best For:**
- Accumulation phase (regular contributions)
- Taxable accounts
- Small drift corrections

### 5. Tactical Rebalancing

**Method:** Rebalance strategically based on market conditions and valuations, not just drift.

**Factors to Consider:**
- Market valuations (Shiller CAPE, valuation metrics)
- Economic cycle position (early, mid, late expansion)
- Volatility regime (VIX levels)
- Sentiment indicators (put/call ratio, investor surveys)

**Example Tactical Adjustments:**
```
Normal target: 60% stocks, 40% bonds

When stocks expensive (CAPE >30):
Adjust to: 50% stocks, 50% bonds (defensive tilt)

When stocks cheap (CAPE <15):
Adjust to: 70% stocks, 30% bonds (aggressive tilt)
```

**Pros:**
- Can enhance returns vs mechanical rebalancing
- Incorporates market insight
- Responds to changing opportunity sets

**Cons:**
- Requires market timing skill (difficult)
- Risk of being wrong
- Subjective judgment required
- Easy to rationalize not rebalancing

**Best For:**
- Sophisticated investors
- Those with market analysis capability
- Supplement to systematic rebalancing (not replacement)

**Warning:** Tactical rebalancing can become an excuse to avoid rebalancing. Use sparingly and document rationale.

## Rebalancing Across Portfolio Dimensions

### Asset Class Rebalancing

**Most Important:** Stock/Bond/Cash allocation drives risk

**Example:**
```
Target: 70% Stocks, 25% Bonds, 5% Cash
Current: 78% Stocks, 20% Bonds, 2% Cash

Rebalancing trades:
- Sell stocks: $10,000 (reduce from 78% to 70%)
- Buy bonds: $6,000 (increase from 20% to 25%)
- Add to cash: $4,000 (increase from 2% to 5%)
```

**Priority:** High - Asset allocation most important driver of risk/return

### Sector Rebalancing

**Purpose:** Prevent sector concentration, maintain diversification

**Example:**
```
Target Allocation:
- Technology: 25%
- Healthcare: 15%
- Financials: 15%
- Consumer: 15%
- Industrials: 10%
- Other: 20%

Current Allocation (after tech rally):
- Technology: 38% (overweight by 13%)
- Healthcare: 12% (underweight by 3%)
- Financials: 13% (underweight by 2%)
- Others: unchanged

Rebalancing:
- Trim Technology from 38% to 25-28% (sell ~10-13%)
- Add to Healthcare and Financials
```

**Priority:** Medium-High - Sector concentration creates risk

### Position-Level Rebalancing

**Purpose:** Trim individual winners, add to losers (if thesis intact)

**Example:**
```
Target: No position >10%, typical position 5-7%

Current Positions:
- NVDA: 18% (winner, appreciated)
- AAPL: 12% (winner)
- MSFT: 8% (on target)
- Others: <5% each

Rebalancing:
- NVDA: Trim from 18% to 10% (sell 8%)
- AAPL: Trim from 12% to 10% (sell 2%)
- Redeploy 10% to underweight positions
```

**Priority:** High if single position >15%, otherwise Medium

### Geographic Rebalancing

**Example:**
```
Target: 70% US, 20% International Developed, 10% Emerging Markets
Current: 75% US, 18% Int'l Dev, 7% EM (US outperformed)

Rebalancing:
- Sell US equities: 5%
- Buy Int'l Developed: 2%
- Buy Emerging Markets: 3%
```

**Priority:** Low to Medium - Less critical than asset class, but maintains diversification

## Rebalancing Implementation Strategies

### Strategy 1: Full Rebalancing (Precise)

**Method:** Simultaneously buy and sell to restore exact target weights.

**Example:**
```
Portfolio: $200,000
Target: 60% Stocks ($120k), 40% Bonds ($80k)
Current: 68% Stocks ($136k), 32% Bonds ($64k)

Trades:
- Sell stocks: $16,000 (reduce to $120k)
- Buy bonds: $16,000 (increase to $80k)

Result: Exactly 60/40
```

**Pros:**
- Precise restoration of targets
- Immediate rebalancing

**Cons:**
- Transaction costs on both sides
- Tax implications (capital gains on sales)
- Market impact if large trades

**Best For:** Tax-advantaged accounts, large drift corrections

### Strategy 2: Partial Rebalancing

**Method:** Rebalance halfway back to target (or other partial percentage).

**Example:**
```
Portfolio: $200,000
Target: 60% Stocks, 40% Bonds
Current: 68% Stocks, 32% Bonds
Drift: Stocks +8%, Bonds -8%

50% Rebalancing:
- Reduce stock overweight by 50%: 68% → 64% (sell $8k stocks)
- Increase bond underweight by 50%: 32% → 36% (buy $8k bonds)

Result: 64/36 (halfway between current and target)
```

**Pros:**
- Lower transaction costs
- Less tax impact
- Preserves some momentum
- Still reduces risk

**Cons:**
- Doesn't fully restore targets
- May need another rebalance soon

**Best For:** Moderate drifts (5-10%), trending markets, taxable accounts

### Strategy 3: Threshold Rebalancing

**Method:** Only rebalance asset classes that exceed threshold.

**Example:**
```
Thresholds: Rebalance only if drift >5%

Current vs Target:
- Stocks: 68% vs 60% (drift +8%) → Rebalance
- Bonds: 32% vs 40% (drift -8%) → Rebalance
- Cash: 0% vs 0% (no drift) → No action

Only stocks and bonds trade, cash unchanged
```

**Pros:**
- Avoids unnecessary trades
- Cost-efficient

**Cons:**
- Portfolio not perfectly balanced

**Best For:** Most situations

### Strategy 4: Opportunistic Rebalancing

**Method:** Rebalance strategically using market volatility.

**Implementation:**
```
Stocks overweight at 68%:
- Set limit order to sell stocks on strength (e.g., at +2% day)
- Wait for rally to execute

Bonds underweight at 32%:
- Set limit order to buy bonds on weakness (e.g., at -1% day)
- Wait for dip to execute

Result: Better execution prices vs market orders
```

**Pros:**
- Improved execution prices
- "Sell high, buy low" even within rebalancing

**Cons:**
- Delayed execution (orders may not fill)
- Requires active monitoring
- Rebalancing may not complete

**Best For:** Patient investors, non-urgent rebalancing

### Strategy 5: Gradual Rebalancing

**Method:** Rebalance over time in multiple tranches.

**Implementation:**
```
Need to trim stocks by 8%:

Week 1: Sell 2% (1/4 of target)
Week 2: Sell 2%
Week 3: Sell 2%
Week 4: Sell 2%

Total: 8% trimmed over one month
```

**Pros:**
- Reduces market impact
- Dollar-cost averaging effect
- Less stressful (not one big decision)

**Cons:**
- Delayed full rebalancing
- Multiple transaction fees
- Complex to track

**Best For:** Large positions, concentrated portfolios, volatile markets

## Tax-Efficient Rebalancing

### Tax-Loss Harvesting During Rebalancing

**Strategy:** Combine rebalancing with tax-loss harvesting to offset gains.

**Example:**
```
Rebalancing Plan:
- Sell Stock A (winner): +$10,000 gain
- Sell Stock B (loser): -$5,000 loss

Tax Impact:
- Net capital gain: $10,000 - $5,000 = $5,000
- Tax (20% long-term): $5,000 × 0.20 = $1,000
- Effective tax rate on Stock A: $1,000 / $10,000 = 10% (vs 20% without harvesting)

Additional benefit: Harvested loss reduces taxes
```

**Best Practices:**
- Prioritize selling losses to offset rebalancing gains
- Harvest losses in December, rebalance in January (timing)
- Avoid wash sale rule (wait 30 days before repurchasing)

### Tax Lot Management

**Strategy:** Select which shares to sell to minimize taxes.

**Methods:**
1. **Specific Identification:** Choose highest-cost shares (minimize gain)
2. **FIFO (First In, First Out):** Sell oldest shares (often long-term)
3. **LIFO (Last In, First Out):** Sell newest shares (minimize gain)
4. **Highest Cost:** Sell shares with highest cost basis (minimize gain)

**Example:**
```
Need to sell 100 shares of AAPL (currently $180):

Purchase lots:
- Lot A: 50 shares @ $150 (2 years ago) → $1,500 gain → $300 tax
- Lot B: 50 shares @ $170 (6 months ago) → $500 gain → $185 tax (short-term)
- Lot C: 50 shares @ $175 (1 month ago) → $250 gain → $93 tax (short-term)

Best approach: Sell Lot C (minimize tax) or Lot A (long-term rates)

Tax savings: $300 - $93 = $207 vs worst choice
```

### Account Location Strategy

**Strategy:** Rebalance in tax-advantaged accounts when possible.

**Tax Treatment by Account Type:**
- **401(k), IRA, Roth IRA:** No tax on trades (best for rebalancing)
- **Taxable brokerage:** Capital gains tax on sales

**Optimization:**
```
Rebalancing needed: Sell $20,000 stocks, buy $20,000 bonds

Option 1 (Non-optimal):
- Sell stocks in taxable account → Trigger $4,000 capital gain → $800 tax

Option 2 (Optimal):
- Sell stocks in IRA → No tax
- Result: Same allocation, $800 saved

If stocks not held in IRA:
- Sell bonds in IRA, buy stocks in IRA
- Sell stocks in taxable, buy bonds in taxable
- Net effect: Rebalanced, but different holdings per account
```

### Tax-Deferred Rebalancing

**Strategy:** Delay rebalancing to next tax year or until qualifying for long-term rates.

**Example:**
```
Need to rebalance in November:
Current: Stock position 6 months old (short-term gains)
Options:
1. Rebalance now → Short-term capital gains (37% max tax)
2. Wait until January (long-term status) → Long-term gains (20% max tax)

Tax savings: 17 percentage points (depends on income)

Decision factors:
- How urgent is rebalancing? (Risk tolerance)
- How much gain? (Tax dollars at stake)
- Market outlook? (Risk of waiting)
```

## Rebalancing in Different Market Environments

### Bull Market Rebalancing

**Characteristics:**
- Stocks consistently outperforming
- Portfolio drifting more aggressive
- Rebalancing means selling winners

**Strategy:**
- Trim equities back to target regularly
- Don't let greed prevent rebalancing
- "No one went broke taking profits"
- Use proceeds to buy underperforming assets

**Emotional Challenge:** Feels like leaving money on the table

**Discipline Required:** Sell winners even when they're going up

### Bear Market Rebalancing

**Characteristics:**
- Stocks underperforming, declining
- Portfolio drifting more conservative
- Rebalancing means buying stocks

**Strategy:**
- Buy equities to restore target (contrarian)
- "Buy when there's blood in the streets"
- Gradual buying (dollar-cost average into weakness)
- Maintain emotional discipline

**Emotional Challenge:** Buying feels risky when markets falling

**Discipline Required:** Buy when fearful, stick to plan

**Example:**
```
2020 COVID Crash:
March: Stocks down 30%
Portfolio drift: 60/40 → 48/52 (stocks fell, bonds rose)
Rebalancing: Buy stocks (sell bonds)
Result: Bought at bottom, participated in recovery
```

### High Volatility Rebalancing

**Characteristics:**
- Wild market swings
- Frequent drift beyond thresholds
- Risk of over-trading

**Strategy:**
- Widen rebalancing thresholds (e.g., 5% → 7%)
- Use partial rebalancing (50% toward target)
- Gradual rebalancing over time
- Avoid panic-driven trades

**Best Practice:** Don't rebalance daily, stick to schedule

### Low Volatility Rebalancing

**Characteristics:**
- Markets calm, low drift
- Infrequent rebalancing needs

**Strategy:**
- May go 12+ months without rebalancing
- Focus on position-level adjustments
- Opportunistic trimming of winners
- Portfolio construction improvements

## Rebalancing Costs and Break-Even Analysis

### Transaction Costs

**Cost Components:**
1. **Commissions:** $0 at most brokers (2024)
2. **Bid-ask spreads:** 0.01-0.10% for liquid stocks, higher for bonds/ETFs
3. **Market impact:** Minimal for small trades, higher for large positions
4. **Taxes:** Largest cost (15-20% long-term, up to 37% short-term)

**Total Cost Estimate:**
```
Rebalancing $50,000 position:
- Bid-ask spread: $50,000 × 0.05% = $25
- Capital gain: $20,000 (assumes doubled)
- Tax (20% long-term): $20,000 × 0.20 = $4,000

Total cost: $4,025 (8% of trade value)
```

### Break-Even Analysis

**Question:** Does rebalancing benefit outweigh costs?

**Benefits of Rebalancing:**
- Risk reduction (volatility drag reduction)
- "Buy low, sell high" systematic discipline
- Maintain target risk level

**Academic Research:**
- Rebalancing adds 0.3-0.5% annual return (after costs) for 60/40 portfolio
- Benefit higher in volatile markets
- Benefit lower in trending markets

**Rule of Thumb:**
```
Rebalance if:
(Expected Risk Reduction Benefit × Time Horizon) > (Transaction Costs + Tax Costs)

Example:
Expected benefit: 0.4% per year
Time horizon: 10 years
Total benefit: ~4%

Costs: 8% (from example above)

Conclusion: Don't rebalance if costs >4% (wait for long-term rates, use tax-advantaged account, or accept drift)
```

## Rebalancing Checklist

### Quarterly Review Checklist

- [ ] **Calculate Current Allocation**
  - Asset class percentages (stocks, bonds, cash, alternatives)
  - Sector percentages (within equities)
  - Position sizes (% of portfolio)
  - Geographic allocation

- [ ] **Compare to Targets**
  - Asset class drift from target (% points)
  - Sector drift from target
  - Position size vs maximum thresholds
  - Identify overweight and underweight areas

- [ ] **Assess Rebalancing Need**
  - Any drift >5%? (Rebalancing recommended)
  - Any position >15%? (Immediate trim)
  - Any sector >35%? (Immediate trim)
  - Overall risk level vs target

- [ ] **Plan Rebalancing Trades**
  - List positions to sell (overweight)
  - List positions to buy (underweight)
  - Calculate trade sizes ($)
  - Select which account to trade in (tax optimization)

- [ ] **Tax Optimization**
  - Identify tax-loss harvest opportunities
  - Select tax lots (highest cost basis)
  - Consider timing (short-term vs long-term)
  - Estimate tax impact

- [ ] **Execute Rebalancing**
  - Place sell orders (overweight positions)
  - Wait for settlement (T+2)
  - Place buy orders (underweight positions)
  - Verify allocation after trades

- [ ] **Document Decision**
  - Record pre-rebalancing allocation
  - Record trades executed
  - Record post-rebalancing allocation
  - Note any deviations from plan
  - Set next review date

## Summary

**Key Principles:**

1. **Systematic discipline** - Rebalance on schedule or threshold, not emotions
2. **Tax efficiency** - Use tax-advantaged accounts, harvest losses, manage lots
3. **Cost awareness** - Balance rebalancing benefits vs transaction costs
4. **Appropriate frequency** - Quarterly or semi-annually for most investors
5. **Maintain perspective** - Rebalancing is risk management, not return maximization

**Recommended Approach for Most Investors:**

- **Frequency:** Quarterly review, rebalance if drift >5%
- **Method:** Hybrid (calendar + threshold)
- **Implementation:** Full rebalancing in tax-advantaged accounts, partial in taxable
- **Tax optimization:** Harvest losses, select tax lots, time for long-term rates

**Remember:** Rebalancing is a risk management tool, not a performance enhancement technique. The primary goal is to maintain your target risk level and prevent portfolio drift. The discipline of rebalancing enforces "buy low, sell high" behavior that is emotionally difficult but mathematically sound.


path: references/risk-profile-questionnaire.md
content: # Risk Profile Questionnaire

This document provides a framework for assessing investor risk tolerance and determining appropriate target asset allocation.

## Overview

Risk profile assessment helps answer:
1. How much volatility can the investor handle emotionally?
2. How much loss can they afford financially?
3. What allocation matches their risk capacity and tolerance?
4. What expected return do they need to meet goals?

**Three Components of Risk Assessment:**

1. **Risk Capacity** - Financial ability to withstand losses (objective)
2. **Risk Tolerance** - Emotional willingness to accept volatility (subjective)
3. **Risk Requirement** - Return needed to achieve goals (objective)

Optimal allocation balances all three components.

## Risk Capacity Assessment (Financial)

Risk capacity is determined by objective financial factors:

### 1. Time Horizon

**Question:** When will you need to withdraw a significant portion of this portfolio?

| Answer | Years | Risk Capacity | Typical Allocation |
|--------|-------|---------------|-------------------|
| **A.** Retired, currently withdrawing | 0-3 | Very Low | 20-30% stocks |
| **B.** Retiring soon | 3-5 | Low | 30-40% stocks |
| **C.** Mid-career, 10-15 years | 10-15 | Medium | 50-70% stocks |
| **D.** Early career, 20+ years | 20-30 | High | 70-85% stocks |
| **E.** Very young, 30+ years | 30+ | Very High | 85-100% stocks |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 3 points
- D = 4 points
- E = 5 points

**Rationale:** Longer time horizons allow recovery from market downturns, supporting higher equity allocation.

### 2. Income Stability

**Question:** How stable and predictable is your income?

| Answer | Risk Capacity Impact |
|--------|---------------------|
| **A.** Fixed pension or annuity (very stable) | Very High (can handle portfolio volatility) |
| **B.** Stable salary, secure job | High |
| **C.** Salary with some variability | Medium |
| **D.** Commission or bonus-heavy | Low |
| **E.** Entrepreneur/self-employed | Low (income correlates with markets) |

**Scoring:**
- A = 5 points
- B = 4 points
- C = 3 points
- D = 2 points
- E = 2 points (or 1 if business is cyclical)

**Rationale:** Stable income allows taking more risk in portfolio; variable income requires conservative portfolio as ballast.

### 3. Net Worth and Liquidity

**Question:** What percentage of your total net worth is this investment portfolio? (Exclude home equity and retirement accounts you can't access)

| Answer | Risk Capacity Impact |
|--------|---------------------|
| **A.** Less than 25% (most wealth elsewhere) | Very High |
| **B.** 25-50% | High |
| **C.** 50-75% | Medium |
| **D.** 75-90% | Low |
| **E.** Over 90% (nearly all wealth) | Very Low |

**Scoring:**
- A = 5 points
- B = 4 points
- C = 3 points
- D = 2 points
- E = 1 point

**Rationale:** If portfolio represents most of your wealth, you can't afford large losses. Diversified wealth allows higher risk in this account.

### 4. Emergency Fund Status

**Question:** Do you have a separate emergency fund (3-6 months expenses) outside this portfolio?

| Answer | Risk Capacity Impact |
|--------|---------------------|
| **A.** Yes, fully funded (6+ months) | High (no need to tap portfolio) |
| **B.** Partially funded (3-4 months) | Medium |
| **C.** No, this portfolio is my emergency fund | Low (need liquidity) |

**Scoring:**
- A = 5 points
- B = 3 points
- C = 1 point

**Rationale:** Emergency fund prevents forced liquidation at market lows; its absence requires higher cash allocation.

### 5. Debt Level

**Question:** What is your debt situation?

| Answer | Risk Capacity Impact |
|--------|---------------------|
| **A.** No debt (or only mortgage) | High |
| **B.** Moderate debt, manageable payments | Medium |
| **C.** High debt, significant payments | Low |
| **D.** High-interest debt (credit cards) | Very Low |

**Scoring:**
- A = 5 points
- B = 3 points
- C = 2 points
- D = 1 point

**Rationale:** High debt reduces capacity to handle portfolio losses; paying down debt may be better use of funds than risky investments.

**Risk Capacity Score (Financial):**
```
Total Points: ___ / 25

20-25 points: Very High Capacity (can handle 80-100% stocks)
15-19 points: High Capacity (60-80% stocks)
10-14 points: Medium Capacity (40-60% stocks)
5-9 points: Low Capacity (20-40% stocks)
0-4 points: Very Low Capacity (0-20% stocks)
```

## Risk Tolerance Assessment (Emotional/Behavioral)

Risk tolerance is subjective - how much volatility can you handle emotionally?

### 1. Loss Reaction

**Question:** If your $100,000 portfolio dropped to $80,000 (-20%) in a market crash, how would you react?

| Answer | Risk Tolerance |
|--------|----------------|
| **A.** Panic, sell everything, can't sleep at night | Very Low |
| **B.** Very concerned, consider selling | Low |
| **C.** Uncomfortable but hold steady | Medium |
| **D.** Stay calm, stick to plan | High |
| **E.** Excited, buy more at lower prices | Very High |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 3 points
- D = 4 points
- E = 5 points

### 2. Historical Behavior

**Question:** Have you experienced a major market downturn (2008, 2020)? How did you react?

| Answer | Risk Tolerance |
|--------|----------------|
| **A.** Sold stocks near the bottom, locked in losses | Very Low |
| **B.** Reduced equity exposure significantly | Low |
| **C.** Held steady, didn't trade | Medium |
| **D.** Held steady and added to stocks | High |
| **E.** Increased equity exposure significantly | Very High |
| **F.** Haven't experienced a major downturn yet | Unknown (rate yourself hypothetically) |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 3 points
- D = 4 points
- E = 5 points
- F = Use answer to Question 1

**Insight:** Past behavior is the best predictor of future behavior. If you sold in prior crashes, you likely will again.

### 3. Sleep Test

**Question:** What is the largest portfolio decline you could tolerate without losing sleep?

| Answer | Drawdown Tolerance | Risk Tolerance | Suitable Allocation |
|--------|-------------------|----------------|---------------------|
| **A.** -5% | Very Low | Very Low | 20% stocks |
| **B.** -10% | Low | Low | 30-40% stocks |
| **C.** -15% | Medium-Low | Medium-Low | 40-50% stocks |
| **D.** -20% | Medium | Medium | 50-60% stocks |
| **E.** -25% | Medium-High | Medium-High | 60-70% stocks |
| **F.** -30% | High | High | 70-80% stocks |
| **G.** -40% or more | Very High | Very High | 80-100% stocks |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 2.5 points
- D = 3 points
- E = 3.5 points
- F = 4 points
- G = 5 points

**Key Insight:** This is the most important question. Be honest - what loss would cause you to sell in panic?

### 4. Investment Timeframe and Patience

**Question:** If your portfolio underperformed the market for 3 years straight, would you:

| Answer | Risk Tolerance |
|--------|----------------|
| **A.** Immediately switch to index funds | Very Low |
| **B.** Re-evaluate and likely make changes within 6 months | Low |
| **C.** Review carefully, make changes if thesis broken | Medium |
| **D.** Stay patient, 3 years is short-term | High |
| **E.** Add more, contrarian opportunity | Very High |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 3 points
- D = 4 points
- E = 5 points

### 5. Volatility Preference

**Question:** Which investment would you prefer?

| Option | Expected Return | Possible Outcomes | Risk Level |
|--------|----------------|-------------------|------------|
| **A.** Conservative | 4% per year | Range: 2% to 6% | Very Low |
| **B.** Moderate | 6% per year | Range: -5% to 15% | Low |
| **C.** Balanced | 8% per year | Range: -10% to 25% | Medium |
| **D.** Growth | 10% per year | Range: -20% to 40% | High |
| **E.** Aggressive | 12% per year | Range: -35% to 60% | Very High |

**Scoring:**
- A = 1 point
- B = 2 points
- C = 3 points
- D = 4 points
- E = 5 points

**Risk Tolerance Score (Emotional):**
```
Total Points: ___ / 25

20-25 points: Very High Tolerance (comfortable with 80-100% stocks)
15-19 points: High Tolerance (comfortable with 60-80% stocks)
10-14 points: Medium Tolerance (comfortable with 40-60% stocks)
5-9 points: Low Tolerance (comfortable with 20-40% stocks)
0-4 points: Very Low Tolerance (comfortable with 0-20% stocks)
```

## Risk Requirement Assessment (Goals)

Risk requirement is determined by what return you need to achieve financial goals.

### 1. Return Needed

**Question:** What annual return do you need to meet your financial goals?

Calculate: Required Return = (Future Goal - Current Savings) / (Years × Current Savings)

Simplified Self-Assessment:

| Required Return | Risk Requirement | Suitable Allocation |
|----------------|-----------------|---------------------|
| **< 4%** | Low (bonds/cash sufficient) | 20-40% stocks |
| **4-6%** | Medium-Low (conservative stocks work) | 40-60% stocks |
| **6-8%** | Medium (balanced portfolio) | 60-70% stocks |
| **8-10%** | Medium-High (equity-heavy) | 70-85% stocks |
| **> 10%** | High (aggressive growth) | 85-100% stocks |

**Scoring:**
- <4% = 1 point
- 4-6% = 2 points
- 6-8% = 3 points
- 8-10% = 4 points
- >10% = 5 points

### 2. Savings Rate

**Question:** Are you contributing regularly to this portfolio?

| Answer | Risk Requirement Impact |
|--------|------------------------|
| **A.** High savings rate (>20% of income) | Low (can achieve goals with lower returns) |
| **B.** Moderate savings rate (10-20%) | Medium |
| **C.** Low savings rate (<10%) | High (need higher returns) |
| **D.** No contributions, portfolio must grow itself | Very High |
| **E.** Net withdrawing from portfolio | N/A (preservation focus) |

**Scoring:**
- A = 1 point (don't need high risk)
- B = 2 points
- C = 4 points (need higher returns)
- D = 5 points
- E = 1 point (focus shifts to preservation)

**Rationale:** High savings rate means goals can be met with lower investment returns; low savings requires taking more risk.

### 3. Goal Flexibility

**Question:** How flexible are your financial goals?

| Answer | Risk Requirement Impact |
|--------|------------------------|
| **A.** Very flexible (can delay retirement, reduce spending) | Low (can afford conservative approach) |
| **B.** Somewhat flexible | Medium |
| **C.** Not flexible (specific retirement date, fixed expenses) | High (must meet return target) |

**Scoring:**
- A = 1 point
- B = 3 points
- C = 5 points

**Risk Requirement Score:**
```
Total Points: ___ / 15

12-15 points: High Requirement (need 70-100% stocks)
9-11 points: Medium-High Requirement (need 60-80% stocks)
6-8 points: Medium Requirement (need 40-60% stocks)
3-5 points: Low Requirement (need 20-40% stocks)
0-2 points: Very Low Requirement (can use conservative allocation)
```

## Synthesizing the Three Assessments

### Step 1: Calculate Component Scores

```
Risk Capacity Score: ___ / 25 → Convert to 1-5 scale = ___
Risk Tolerance Score: ___ / 25 → Convert to 1-5 scale = ___
Risk Requirement Score: ___ / 15 → Convert to 1-5 scale = ___
```

**Conversion Table:**

| Raw Score (out of max) | Converted Score (1-5) |
|------------------------|----------------------|
| 0-20% | 1 |
| 21-40% | 2 |
| 41-60% | 3 |
| 61-80% | 4 |
| 81-100% | 5 |

### Step 2: Determine Overall Risk Profile

**Method 1: Conservative (Recommended for Most Investors)**

Use the **lowest** of the three scores. This ensures you don't take more risk than you can handle.

```
Risk Capacity: 4
Risk Tolerance: 2 ← Lowest
Risk Requirement: 4

Overall Risk Profile: 2 (Low)
Recommended Allocation: 30-40% stocks
```

**Rationale:** If emotional tolerance is low (2), it doesn't matter that capacity and requirement are higher - investor will sell in panic during crash.

**Method 2: Balanced**

Use the **average** of the three scores.

```
Risk Capacity: 4
Risk Tolerance: 2
Risk Requirement: 4

Average: (4 + 2 + 4) / 3 = 3.33 → 3 (Medium)
Recommended Allocation: 50-60% stocks
```

**Rationale:** Balances all factors, may take slightly more risk than emotional tolerance suggests.

**Method 3: Adaptive**

Weight the scores based on individual circumstances:

```
Typical weighting:
Risk Tolerance: 50% (most important - behavioral)
Risk Capacity: 30% (financial constraints)
Risk Requirement: 20% (goals)

Example:
Capacity: 4 × 0.30 = 1.2
Tolerance: 2 × 0.50 = 1.0
Requirement: 4 × 0.20 = 0.8

Weighted Score: 1.2 + 1.0 + 0.8 = 3.0 (Medium)
```

### Step 3: Map to Asset Allocation

| Overall Risk Score | Risk Profile | Recommended Stocks % | Recommended Bonds % |
|-------------------|--------------|---------------------|---------------------|
| **1.0 - 1.5** | Very Low (Conservative) | 20-30% | 60-70% |
| **1.6 - 2.5** | Low (Conservative) | 30-40% | 50-60% |
| **2.6 - 3.5** | Medium (Moderate) | 50-60% | 35-45% |
| **3.6 - 4.5** | High (Growth) | 70-80% | 15-25% |
| **4.6 - 5.0** | Very High (Aggressive) | 85-100% | 0-10% |

### Step 4: Resolve Conflicts

**Conflict Example:**

```
Risk Capacity: 5 (Very High - young, stable income, long horizon)
Risk Tolerance: 2 (Low - can't handle volatility emotionally)
Risk Requirement: 4 (High - need high returns to meet goals)
```

**Resolution:**

This investor **needs** to take risk (requirement), **can** take risk (capacity), but **can't handle** risk emotionally (tolerance).

**Options:**

1. **Conservative approach (Recommended):**
   - Use risk tolerance as limit (30-40% stocks)
   - Accept that goals may not be met with investment returns alone
   - Increase savings rate to compensate for lower returns
   - Work longer or reduce spending goals

2. **Education approach:**
   - Work on improving risk tolerance through education
   - Start with moderate allocation (50% stocks)
   - Gradually increase equity exposure as comfort grows
   - Build tolerance through experience

3. **Mismatch acceptance (Not Recommended):**
   - Use higher allocation (70%+ stocks) despite low tolerance
   - **Risk:** Will likely panic-sell in crash, locking in losses
   - **Outcome:** Worst of both worlds - volatility AND poor returns

**Best Practice:** Never exceed emotional risk tolerance. If goals can't be met with acceptable risk level, adjust goals or increase savings.

## Risk Profile Classification

### Conservative Profile (Risk Score: 1-2)

**Characteristics:**
- Low risk tolerance (can't handle >10-15% loss)
- Near retirement or retired
- Portfolio represents most of wealth
- Needs capital preservation and income

**Recommended Allocation:** 20-40% stocks, 60-80% bonds

**Behavioral Tendencies:**
- May sell stocks during corrections (>10% drop)
- Prefers stability over growth
- Anxious about volatility
- Needs reassurance during downturns

**Management Approach:**
- Conservative allocation with high bond allocation
- Focus on dividend income and bond interest
- Avoid volatile stocks (high-beta tech)
- Regular communication during volatility
- Emphasis on stability and capital preservation

### Moderate Profile (Risk Score: 2.6-3.5)

**Characteristics:**
- Medium risk tolerance (can handle 15-25% loss)
- Mid-career, 10-20 year horizon
- Balanced income and growth needs
- Some anxiety about volatility but can stay the course

**Recommended Allocation:** 50-60% stocks, 35-45% bonds

**Behavioral Tendencies:**
- May consider selling in bear markets but likely holds
- Wants growth but also wants to sleep at night
- Seeks balanced approach
- Needs data and reassurance during volatility

**Management Approach:**
- Balanced portfolio with stock and bond components
- Diversified across sectors and asset classes
- Regular rebalancing to maintain targets
- Education on long-term perspective
- Quarterly reviews with clear communication

### Growth Profile (Risk Score: 3.6-4.5)

**Characteristics:**
- High risk tolerance (can handle 25-35% loss)
- Long time horizon (15-30 years)
- Focus on capital appreciation
- Emotionally stable during volatility

**Recommended Allocation:** 70-80% stocks, 15-25% bonds

**Behavioral Tendencies:**
- Stays invested during downturns
- May add to stocks during corrections
- Comfortable with volatility
- Understands risk/reward tradeoffs

**Management Approach:**
- Equity-heavy portfolio with growth focus
- Diversified across sectors and geographies
- Limited bond allocation (volatility dampening only)
- Emphasis on long-term performance
- Semi-annual or annual reviews

### Aggressive Profile (Risk Score: 4.6-5.0)

**Characteristics:**
- Very high risk tolerance (can handle >35% loss)
- Very long time horizon (25+ years)
- Seeks maximum growth
- Views volatility as opportunity

**Recommended Allocation:** 85-100% stocks, 0-10% bonds

**Behavioral Tendencies:**
- Buys during crashes
- Comfortable with extreme volatility
- Focuses on long-term compounding
- Rational decision-making during panic

**Management Approach:**
- Equity-focused or 100% equity portfolio
- Growth-oriented stock selection
- International and emerging market exposure
- Minimal to no bonds
- Annual reviews with emphasis on strategy

## Questionnaire Summary

Use this simplified questionnaire for quick assessment:

```
INVESTOR RISK PROFILE QUESTIONNAIRE

Name: _______________  Date: _______________

1. Age: ___ → Time horizon: ___ years

2. Investment time horizon before major withdrawal:
   [ ] 0-5 years  [ ] 5-10 years  [ ] 10-20 years  [ ] 20+ years

3. What is the maximum portfolio decline you could tolerate?
   [ ] -5%  [ ] -10%  [ ] -15%  [ ] -20%  [ ] -30%  [ ] -40%+

4. Income stability:
   [ ] Very stable (pension)  [ ] Stable (salary)  [ ] Variable (commission/business)

5. This portfolio represents what % of your net worth?
   [ ] <25%  [ ] 25-50%  [ ] 50-75%  [ ] >75%

6. Emergency fund status:
   [ ] Fully funded (6+ months)  [ ] Partial (3 months)  [ ] None

7. If market crashed 25%, would you:
   [ ] Panic sell  [ ] Sell some  [ ] Hold steady  [ ] Buy more

8. Investment experience with bear markets:
   [ ] Never experienced  [ ] Experienced, sold stocks  [ ] Experienced, held  [ ] Experienced, bought more

9. Return needed to meet goals:
   [ ] <4%  [ ] 4-6%  [ ] 6-8%  [ ] 8-10%  [ ] >10%

10. Primary investment objective:
    [ ] Capital preservation  [ ] Income  [ ] Balanced growth & income  [ ] Growth  [ ] Aggressive growth

SCORING & RECOMMENDATION:

Risk Capacity Score: ___ / 25
Risk Tolerance Score: ___ / 25
Risk Requirement Score: ___ / 15

Overall Risk Profile: [ ] Conservative  [ ] Moderate  [ ] Growth  [ ] Aggressive

Recommended Allocation:
Stocks: ___%
Bonds: ___%
Cash: ___%

Notes:
________________________________________________________________
________________________________________________________________
________________________________________________________________

Advisor Signature: _______________  Client Signature: _______________
```

## Summary

**Key Principles:**

1. **Three-dimensional assessment:** Capacity, Tolerance, Requirement
2. **Tolerance is the constraint:** Never exceed emotional tolerance
3. **Honest self-assessment:** Past behavior predicts future behavior
4. **Resolve conflicts conservatively:** When scores conflict, use lowest
5. **Periodic reassessment:** Risk profile changes with age and circumstances
6. **Allocation must match profile:** Mismatch leads to behavioral errors

**Remember:** The best allocation is one you can stick with through market cycles. It's better to have a moderate allocation you can maintain than an aggressive allocation you'll abandon in a crash. Behavioral discipline matters more than optimal allocation.


path: references/target-allocations.md
content: # Target Allocation Models

This document provides model portfolio allocations for different investor risk profiles, serving as benchmarks for portfolio analysis and rebalancing.

## Overview

Target allocations provide a framework for:
1. Assessing if current portfolio matches investor risk tolerance
2. Identifying allocation gaps and concentration risks
3. Guiding rebalancing decisions
4. Setting position sizing guidelines

**Important:** These are templates, not prescriptions. Actual allocations should be customized based on individual circumstances, goals, time horizon, and constraints.

## Investor Risk Profile Classification

### Factors Determining Risk Profile

| Factor | Conservative | Moderate | Growth | Aggressive |
|--------|-------------|----------|--------|------------|
| **Age** | 60+ | 45-60 | 30-45 | <30 |
| **Time Horizon** | 0-5 years | 5-15 years | 15-25 years | 25+ years |
| **Income Stability** | Fixed income (retired) | Stable salary | Growing career | Variable/high |
| **Net Worth** | Low to moderate | Moderate | High | Very high |
| **Loss Tolerance** | Cannot afford >10% loss | Can handle 15-25% loss | Can handle 25-35% loss | Can handle >40% loss |
| **Investment Goal** | Preserve capital, income | Balanced growth & income | Long-term growth | Maximum growth |
| **Market Experience** | Limited | Moderate | Experienced | Very experienced |

**Self-Assessment:**
Rate yourself on each factor, assign the corresponding risk profile, and determine your overall profile based on the majority classification.

## Conservative Portfolio (Capital Preservation)

### Profile
- **Investor:** Near or in retirement, low risk tolerance, need for income and capital preservation
- **Time Horizon:** 0-5 years
- **Max Acceptable Drawdown:** -10 to -15%
- **Expected Annual Return:** 4-6%
- **Expected Volatility:** 6-10%

### Asset Allocation

```
Total Portfolio Allocation:
├── Equities: 30%
│   ├── US Stocks: 20%
│   ├── International Developed: 7%
│   └── Emerging Markets: 3%
├── Fixed Income: 55%
│   ├── Investment Grade Bonds: 30%
│   ├── Government Bonds: 20%
│   └── High Yield Bonds: 5%
├── Cash & Equivalents: 10%
└── Alternatives (Optional): 5%
    ├── REITs: 3%
    └── Gold: 2%
```

### Equity Allocation (30% of total portfolio)

**US Stocks (20% of total, 67% of equity):**

| Sector | % of Total Portfolio | % of US Equity | Characteristics |
|--------|---------------------|----------------|-----------------|
| **Utilities** | 3.5% | 17.5% | High dividends, stable cash flows |
| **Consumer Staples** | 3.0% | 15.0% | Defensive, recession-resistant |
| **Healthcare** | 3.5% | 17.5% | Defensive with growth potential |
| **Financials** | 2.5% | 12.5% | Dividend income, moderate growth |
| **Technology** | 2.5% | 12.5% | Quality large-caps only (AAPL, MSFT) |
| **Communication Services** | 2.0% | 10.0% | Stable cash flows (T, VZ) |
| **Consumer Discretionary** | 1.5% | 7.5% | Underweight cyclicals |
| **Industrials** | 1.0% | 5.0% | Minimal exposure |
| **Real Estate** | 0.5% | 2.5% | Via separate REIT allocation |
| **Energy** | 0% | 0% | Avoid volatility |
| **Materials** | 0% | 0% | Avoid volatility |

**International & Emerging (10% of total, 33% of equity):**
- International Developed: 7% (Europe, Japan, UK - stable, dividend-focused)
- Emerging Markets: 3% (minimal exposure, diversification only)

**Position Sizing:**
- Maximum single position: 5% of total portfolio
- Typical position: 2-3%
- Number of positions: 12-20 stocks OR 4-6 diversified ETFs

**Preferred Holdings:**
- Large-cap dividend aristocrats (25+ years of dividend growth)
- Defensive sectors with recession resistance
- Low beta stocks (β < 0.8)
- Established companies with strong balance sheets

**Example Portfolio (ETF-based):**
- 10% VZ (Verizon) - Telecom, 6% yield
- 10% JNJ (Johnson & Johnson) - Healthcare, dividend aristocrat
- 10% PG (Procter & Gamble) - Consumer staples, stable
- 5% SO (Southern Company) - Utility, high yield
- 5% KO (Coca-Cola) - Consumer staples, dividend
- 5% PFE (Pfizer) - Healthcare, value
- (Or equivalent via dividend-focused ETFs: VYM, SCHD, DVY)

### Fixed Income Allocation (55% of total portfolio)

| Bond Type | % of Total Portfolio | Purpose |
|-----------|---------------------|---------|
| **Investment Grade Corporate** | 30% | Income, moderate risk |
| **US Treasury Bonds** | 15% | Safety, low risk |
| **TIPS (Inflation-Protected)** | 5% | Inflation hedge |
| **High Yield (Junk Bonds)** | 5% | Higher income, higher risk |

**Duration:** Short to intermediate (3-7 years) to reduce interest rate risk

**Example Holdings:**
- AGG (Core Bond ETF)
- BND (Total Bond Market)
- LQD (Investment Grade Corporate)
- TIP (TIPS)
- HYG (High Yield - small allocation)

### Cash & Equivalents (10%)

**Purpose:**
- Emergency liquidity
- Opportunistic buying on dips
- Reduce overall volatility

**Holdings:**
- Money market funds
- Short-term Treasury bills
- High-yield savings accounts

---

## Moderate Portfolio (Balanced Growth & Income)

### Profile
- **Investor:** Mid-career, balanced objectives, moderate risk tolerance
- **Time Horizon:** 5-15 years
- **Max Acceptable Drawdown:** -15 to -25%
- **Expected Annual Return:** 6-8%
- **Expected Volatility:** 10-14%

### Asset Allocation

```
Total Portfolio Allocation:
├── Equities: 60%
│   ├── US Stocks: 42%
│   ├── International Developed: 12%
│   └── Emerging Markets: 6%
├── Fixed Income: 32%
│   ├── Investment Grade Bonds: 20%
│   ├── Government Bonds: 7%
│   └── High Yield Bonds: 5%
├── Cash & Equivalents: 5%
└── Alternatives (Optional): 3%
    ├── REITs: 2%
    └── Commodities/Gold: 1%
```

### Equity Allocation (60% of total portfolio)

**US Stocks (42% of total, 70% of equity):**

| Sector | % of Total Portfolio | % of US Equity | Benchmark (S&P 500) |
|--------|---------------------|----------------|---------------------|
| **Technology** | 11.0% | 26% | 28% |
| **Healthcare** | 7.0% | 17% | 13% |
| **Financials** | 6.0% | 14% | 13% |
| **Consumer Discretionary** | 5.5% | 13% | 11% |
| **Industrials** | 4.0% | 10% | 9% |
| **Consumer Staples** | 3.5% | 8% | 7% |
| **Communication Services** | 2.5% | 6% | 9% |
| **Energy** | 1.0% | 2% | 4% |
| **Utilities** | 1.0% | 2% | 3% |
| **Real Estate** | 0.5% | 1% | 3% |
| **Materials** | 0.5% | 1% | 3% |

**Sector Strategy:**
- Slight overweight in Technology and Healthcare (growth + quality)
- Balanced exposure to Financials and Consumer sectors
- Underweight Energy and Materials (volatility)
- Defensive sectors (Utilities, Staples) lower than conservative portfolio

**International & Emerging (18% of total, 30% of equity):**
- International Developed: 12% (Europe, Japan, UK, Canada)
- Emerging Markets: 6% (China, India, Brazil - growth exposure)

**Position Sizing:**
- Maximum single position: 8% of total portfolio
- High conviction positions: 6-8%
- Medium conviction: 4-6%
- Low conviction: 2-3%
- Number of positions: 15-25 stocks OR 6-10 ETFs

**Market Cap Distribution:**
- Large-cap (>$10B): 70% of US equity
- Mid-cap ($2-10B): 20%
- Small-cap (<$2B): 10%

**Example Portfolio (Individual Stocks):**
- 8% MSFT - Technology, quality growth
- 7% AAPL - Technology, ecosystem
- 6% GOOGL - Technology, advertising
- 6% JNJ - Healthcare, defensive
- 5% JPM - Financials, dividend
- 5% UNH - Healthcare, growth
- 4% V - Financials, payments
- 4% HD - Consumer Discretionary, housing
- 4% DIS - Communication, entertainment
- 3% BA - Industrials, aerospace
- (Additional 15% in 8-10 smaller positions)
- 18% International (VEA, VWO, or individual stocks)

### Fixed Income Allocation (32% of total portfolio)

| Bond Type | % of Total Portfolio | Purpose |
|-----------|---------------------|---------|
| **Investment Grade Corporate** | 20% | Core income, moderate risk |
| **US Treasury Bonds** | 5% | Safety ballast |
| **TIPS** | 2% | Inflation hedge |
| **High Yield Bonds** | 5% | Enhanced income |

**Duration:** Intermediate (5-10 years)

---

## Growth Portfolio (Long-Term Capital Appreciation)

### Profile
- **Investor:** Younger investor, long time horizon, growth-focused
- **Time Horizon:** 15-25 years
- **Max Acceptable Drawdown:** -25 to -35%
- **Expected Annual Return:** 8-10%
- **Expected Volatility:** 14-18%

### Asset Allocation

```
Total Portfolio Allocation:
├── Equities: 80%
│   ├── US Stocks: 52%
│   ├── International Developed: 18%
│   └── Emerging Markets: 10%
├── Fixed Income: 15%
│   ├── Investment Grade Bonds: 8%
│   └── High Yield Bonds: 7%
├── Cash & Equivalents: 3%
└── Alternatives: 2%
    └── REITs or Commodities: 2%
```

### Equity Allocation (80% of total portfolio)

**US Stocks (52% of total, 65% of equity):**

| Sector | % of Total Portfolio | % of US Equity | Notes |
|--------|---------------------|----------------|-------|
| **Technology** | 16.0% | 31% | Growth focus, secular trends |
| **Healthcare** | 8.0% | 15% | Innovation, demographics |
| **Consumer Discretionary** | 7.5% | 14% | Economic growth exposure |
| **Communication Services** | 6.0% | 12% | Digital transformation |
| **Financials** | 5.5% | 11% | Economic expansion |
| **Industrials** | 5.0% | 10% | Capital spending cycles |
| **Consumer Staples** | 2.0% | 4% | Underweight defensive |
| **Energy** | 1.0% | 2% | Minimal exposure |
| **Materials** | 0.5% | 1% | Minimal exposure |
| **Utilities** | 0.5% | 1% | Minimal exposure |
| **Real Estate** | 0% | 0% | Separate REIT allocation |

**Sector Strategy:**
- Heavy overweight Technology (innovation, secular growth)
- Overweight Healthcare (demographics, innovation)
- Growth and cyclical sectors emphasized
- Minimal defensive sectors (don't need stability)

**International & Emerging (28% of total, 35% of equity):**
- International Developed: 18% (quality international growth)
- Emerging Markets: 10% (higher growth potential)

**Position Sizing:**
- Maximum single position: 10% of total portfolio
- High conviction positions: 8-10%
- Medium conviction: 5-7%
- Low conviction: 2-4%
- Number of positions: 15-30 stocks

**Market Cap Distribution:**
- Large-cap: 60% of US equity
- Mid-cap: 25%
- Small-cap: 15% (growth potential)

**Growth vs Value Tilt:** Balanced to slight growth tilt (not extreme)

**Example Portfolio:**
- 10% NVDA - Technology, AI leadership
- 9% MSFT - Technology, cloud + AI
- 8% AAPL - Technology, ecosystem
- 7% GOOGL - Technology, AI + advertising
- 6% AMZN - Consumer Discretionary, AWS
- 6% META - Communication, digital advertising
- 5% TSLA - Consumer Discretionary, EV + energy
- 5% UNH - Healthcare, managed care
- 4% V - Financials, payments
- 4% MA - Financials, payments
- (Remaining 36% in 15-20 smaller positions + international)

### Fixed Income Allocation (15% of total portfolio)

| Bond Type | % of Total Portfolio | Purpose |
|-----------|---------------------|---------|
| **Investment Grade Corporate** | 8% | Moderate income, volatility dampening |
| **High Yield Bonds** | 7% | Enhanced returns, equity-like exposure |

**Duration:** Intermediate to long (7-15 years) - can handle rate risk

---

## Aggressive Portfolio (Maximum Growth)

### Profile
- **Investor:** Young, high income, very high risk tolerance, long horizon
- **Time Horizon:** 20+ years
- **Max Acceptable Drawdown:** -35 to -50%
- **Expected Annual Return:** 9-12%
- **Expected Volatility:** 18-22%

### Asset Allocation

```
Total Portfolio Allocation:
├── Equities: 95%
│   ├── US Stocks: 57%
│   ├── International Developed: 23%
│   └── Emerging Markets: 15%
├── Fixed Income: 0-5%
└── Cash & Equivalents: 0-5%
```

### Equity Allocation (95% of total portfolio)

**US Stocks (57% of total, 60% of equity):**

| Sector | % of Total Portfolio | % of US Equity | Strategy |
|--------|---------------------|----------------|----------|
| **Technology** | 20.0% | 35% | Maximum exposure to innovation |
| **Healthcare** | 9.0% | 16% | Biotech, medical devices, innovation |
| **Consumer Discretionary** | 9.0% | 16% | E-commerce, luxury, travel |
| **Communication Services** | 6.0% | 11% | Digital platforms, streaming |
| **Financials** | 6.0% | 11% | Fintechs, growth-oriented |
| **Industrials** | 4.0% | 7% | Aerospace, automation |
| **Consumer Staples** | 1.0% | 2% | Minimal |
| **Energy** | 1.0% | 2% | Renewables focus |
| **Materials** | 0.5% | 1% | Minimal |
| **Utilities** | 0.5% | 1% | Minimal |

**Sector Strategy:**
- Extreme overweight Technology (35% vs 28% benchmark)
- Growth sectors dominate (80%+ of portfolio)
- Minimal defensive exposure
- Willing to accept high volatility

**International & Emerging (38% of total, 40% of equity):**
- International Developed: 23% (European tech, Asian growth)
- Emerging Markets: 15% (China tech, India growth, LatAm)

**Position Sizing:**
- Maximum single position: 12% of total portfolio
- High conviction positions: 10-12%
- Medium conviction: 6-9%
- Low conviction: 3-5%
- Number of positions: 12-25 stocks (concentrated)

**Market Cap Distribution:**
- Large-cap: 55%
- Mid-cap: 30%
- Small-cap: 15% (higher growth potential, higher risk)

**Growth vs Value:** Strong growth tilt

**Style Characteristics:**
- High P/E ratios acceptable (growth premium)
- Focus on revenue growth over profitability (for some positions)
- Secular themes: AI, cloud, EVs, fintech, biotech
- May include speculative positions (5-10% total)

**Example Portfolio:**
- 12% NVDA - Technology, AI chips
- 10% TSLA - Consumer Discretionary, EVs + autonomy
- 9% MSFT - Technology, cloud + AI
- 8% GOOGL - Technology, AI + advertising
- 8% META - Communication, VR/AI
- 7% AMZN - Consumer Discretionary, AWS
- 6% AAPL - Technology, ecosystem
- 5% SHOP - Technology, e-commerce platform
- 5% SQ - Fintech, payments
- 4% CRSP - Healthcare, gene editing
- 4% ENPH - Energy, solar
- (Remaining 22% in smaller growth positions + international exposure)

### Fixed Income Allocation (0-5% of total portfolio)

**Minimal to none:**
- 0-5% investment grade or cash for liquidity only
- No need for volatility dampening given time horizon
- 100% equity acceptable for this profile

---

## Specialized Allocation Considerations

### Dividend Income Portfolio

**Objective:** Maximize current income while preserving capital

**Allocation:**
- Equities: 60% (dividend-focused)
  - High-yield stocks (4-7% yields): 40%
  - Dividend growth stocks: 20%
- Fixed Income: 30% (income-focused)
  - Investment grade corporate: 15%
  - High yield bonds: 10%
  - Preferred stocks: 5%
- REITs: 10% (high dividends, inflation hedge)

**Target Yield:** 4-6% on total portfolio

### Tax-Efficient Portfolio (Taxable Account)

**Considerations:**
- Minimize turnover (reduce capital gains)
- Favor qualified dividends and long-term gains
- Tax-loss harvesting opportunities
- Municipal bonds (if high tax bracket)

**Allocation Adjustments:**
- Growth stocks (low/no dividends): Higher weight
- Municipal bonds: Replace corporate bonds
- Index funds: Higher weight vs active funds
- International: Lower weight (foreign tax complexity)

### Retirement Portfolio (Post-Retirement)

**Objective:** Generate income, preserve capital, manage longevity risk

**Allocation (varies by age):**
- Age 65: 40/60 stocks/bonds
- Age 75: 30/70 stocks/bonds
- Age 85: 20/80 stocks/bonds

**Income Strategy:**
- 4% withdrawal rate (sustainable)
- Bucket approach:
  - Bucket 1 (0-2 years expenses): Cash
  - Bucket 2 (3-7 years): Bonds
  - Bucket 3 (8+ years): Stocks

---

## Position Sizing Guidelines by Risk Profile

| Risk Profile | Max Single Position | Typical Position | Min # of Stocks | Max # of Stocks |
|--------------|--------------------|--------------------|----------------|----------------|
| **Conservative** | 5% | 2-3% | 12 | 20 |
| **Moderate** | 8% | 4-6% | 15 | 25 |
| **Growth** | 10% | 5-7% | 15 | 30 |
| **Aggressive** | 12% | 6-9% | 12 | 25 |

**Single Sector Maximums:**

| Risk Profile | Max Single Sector |
|--------------|------------------|
| **Conservative** | 25% |
| **Moderate** | 30% |
| **Growth** | 35% |
| **Aggressive** | 40% |

---

## Rebalancing Triggers by Risk Profile

| Risk Profile | Rebalancing Frequency | Asset Class Drift Trigger | Position Drift Trigger |
|--------------|----------------------|--------------------------|------------------------|
| **Conservative** | Quarterly | >3% | >2% |
| **Moderate** | Quarterly | >5% | >3% |
| **Growth** | Semi-Annually | >7% | >4% |
| **Aggressive** | Annually | >10% | >5% |

---

## Lifecycle Allocation (Age-Based)

**Traditional Rule of Thumb:** "120 minus your age" in stocks

| Age | Stock % | Bond % | Formula |
|-----|---------|--------|---------|
| 25 | 95% | 5% | 120 - 25 |
| 35 | 85% | 15% | 120 - 35 |
| 45 | 75% | 25% | 120 - 45 |
| 55 | 65% | 35% | 120 - 55 |
| 65 | 55% | 45% | 120 - 65 |
| 75 | 45% | 55% | 120 - 75 |

**Modern Adjustment:** "130 minus your age" (accounts for longer lifespans, low interest rates)

---

## Using Target Allocations in Portfolio Analysis

### 1. Identify Current Allocation
Calculate actual portfolio percentages across:
- Asset classes (stocks/bonds/cash)
- Sectors (within stocks)
- Geographic regions
- Market caps

### 2. Compare to Target Model
Select appropriate model based on:
- Investor risk tolerance assessment
- Time horizon
- Financial situation
- Goals

### 3. Calculate Deviations
```
Deviation = Current % - Target %

Example:
Target (Moderate): 60% stocks
Current: 68% stocks
Deviation: +8% (overweight stocks)
```

### 4. Generate Rebalancing Plan
- Trim overweight positions/sectors
- Add to underweight positions/sectors
- Prioritize based on magnitude of deviation

### 5. Adjust for Individual Circumstances
Templates are starting points, not rigid rules:
- Tax situation may favor certain holdings
- Unique expertise may justify sector overweight
- Employer stock may create concentration
- Real estate holdings (home) affect allocation

---

## Summary

**Key Takeaways:**

1. **Target allocations are guidelines,** not mandates - customize to individual circumstances
2. **Risk profile drives allocation** - match stocks/bonds to risk tolerance and time horizon
3. **Sector allocation matters** - within equity allocation, sector mix drives risk and return
4. **Position sizing discipline** - enforce maximum position sizes to control concentration
5. **Rebalance systematically** - maintain target allocation over time, don't drift unintentionally
6. **Lifecycle matters** - adjust allocation as you age and circumstances change

**Remember:** The best allocation is one you can stick with through market cycles. Don't choose an aggressive allocation if you'll panic-sell in a 30% drawdown. Match allocation to your true risk tolerance, not your aspirational risk tolerance.


path: scripts/test_alpaca_connection.py
content: #!/usr/bin/env python3
"""
Test script for Alpaca API connection.

This script verifies that Alpaca API credentials are correctly configured
and tests basic API functionality.

Usage:
    python3 test_alpaca_connection.py

Environment Variables:
    ALPACA_API_KEY: Your Alpaca API Key ID
    ALPACA_SECRET_KEY: Your Alpaca Secret Key
    ALPACA_PAPER: Set to 'true' for paper trading, 'false' for live (default: true)
"""

import os
import sys

try:
    import requests
except ImportError:
    print("ERROR: requests library not installed")
    print("Install with: pip install requests")
    sys.exit(1)


def load_credentials():
    """Load Alpaca API credentials from environment variables."""
    [REDACTED_SECRET]'ALPACA_API_KEY')
    secret_key = os.environ.get('ALPACA_SECRET_KEY')
    paper = os.environ.get('ALPACA_PAPER', 'true').lower() == 'true'

    if not api_key or not secret_key:
        print("ERROR: Alpaca API credentials not found")
        print("\nPlease set environment variables:")
        print("  export ALPACA_API_KEY='your_api_key_id'")
        print("  export ALPACA_SECRET_KEY='your_secret_key'")
        print("  export ALPACA_PAPER='true'  # or 'false' for live trading")
        print("\nOr add to your shell config file (~/.bashrc or ~/.zshrc):")
        print("  echo 'export ALPACA_API_KEY=\"your_key\"' >> ~/.bashrc")
        print("  echo 'export ALPACA_SECRET_KEY=\"your_secret\"' >> ~/.bashrc")
        print("  echo 'export ALPACA_PAPER=\"true\"' >> ~/.bashrc")
        print("  source ~/.bashrc")
        sys.exit(1)

    return api_key, secret_key, paper


def get_base_url(paper=True):
    """Get appropriate Alpaca API base URL."""
    if paper:
        return "https://paper-api.alpaca.markets"
    else:
        return "https://api.alpaca.markets"


def test_account_info(api_key, secret_key, base_url):
    """Test account information endpoint."""
    print("\n" + "="*60)
    print("Testing Alpaca Account API Connection")
    print("="*60)

    headers = {
        'APCA-API-KEY-ID': api_key,
        'APCA-API-SECRET-KEY': secret_key
    }

    try:
        response = requests.get(f"{base_url}/v2/account", headers=headers)

        if response.status_code == 200:
            account = response.json()
            print("✓ Successfully connected to Alpaca API\n")
            print(f"Account Status: {account.get('status')}")
            print(f"Account Number: {account.get('account_number')}")
            print(f"Equity: ${float(account.get('equity', 0)):,.2f}")
            print(f"Cash: ${float(account.get('cash', 0)):,.2f}")
            print(f"Buying Power: ${float(account.get('buying_power', 0)):,.2f}")
            print(f"Portfolio Value: ${float(account.get('portfolio_value', 0)):,.2f}")

            # Check if account is restricted
            if account.get('account_blocked') or account.get('trading_blocked'):
                print("\n⚠ WARNING: Account has restrictions")
                if account.get('account_blocked'):
                    print("  - Account is blocked")
                if account.get('trading_blocked'):
                    print("  - Trading is blocked")

            return True

        elif response.status_code == 401:
            print("✗ Authentication failed")
            print("\nPossible causes:")
            print("  1. Invalid API credentials")
            print("  2. Using paper trading keys with live URL (or vice versa)")
            print("  3. API keys have been revoked")
            print("\nSolutions:")
            print("  1. Verify API Key ID and Secret Key in Alpaca dashboard")
            print("  2. Check ALPACA_PAPER environment variable matches your keys")
            print("  3. Regenerate API keys if needed")
            return False

        elif response.status_code == 403:
            print("✗ Forbidden - insufficient permissions")
            print("\nPossible causes:")
            print("  1. API keys don't have required permissions")
            print("  2. Account not approved for trading")
            print("\nSolutions:")
            print("  1. Regenerate API keys with full permissions")
            print("  2. Complete account approval process in Alpaca dashboard")
            return False

        else:
            print(f"✗ Unexpected error: HTTP {response.status_code}")
            print(f"Response: {response.text}")
            return False

    except requests.exceptions.RequestException as e:
        print(f"✗ Network error: {e}")
        print("\nPossible causes:")
        print("  1. No internet connection")
        print("  2. Alpaca API is down (check status.alpaca.markets)")
        print("  3. Firewall blocking connection")
        return False


def test_positions(api_key, secret_key, base_url):
    """Test positions endpoint."""
    print("\n" + "="*60)
    print("Testing Positions API")
    print("="*60)

    headers = {
        'APCA-API-KEY-ID': api_key,
        'APCA-API-SECRET-KEY': secret_key
    }

    try:
        response = requests.get(f"{base_url}/v2/positions", headers=headers)

        if response.status_code == 200:
            positions = response.json()

            if len(positions) == 0:
                print("✓ API connection successful")
                print("Portfolio is empty (no positions)")
            else:
                print(f"✓ API connection successful")
                print(f"Found {len(positions)} position(s):\n")

                total_value = 0
                total_pl = 0

                for pos in positions:
                    symbol = pos.get('symbol')
                    qty = float(pos.get('qty', 0))
                    avg_price = float(pos.get('avg_entry_price', 0))
                    current_price = float(pos.get('current_price', 0))
                    market_value = float(pos.get('market_value', 0))
                    unrealized_pl = float(pos.get('unrealized_pl', 0))
                    unrealized_plpc = float(pos.get('unrealized_plpc', 0)) * 100

                    total_value += market_value
                    total_pl += unrealized_pl

                    pl_sign = '+' if unrealized_pl >= 0 else ''

                    print(f"{symbol}:")
                    print(f"  Quantity: {qty:.2f} shares")
                    print(f"  Avg Entry: ${avg_price:.2f}")
                    print(f"  Current Price: ${current_price:.2f}")
                    print(f"  Market Value: ${market_value:,.2f}")
                    print(f"  Unrealized P/L: {pl_sign}${unrealized_pl:,.2f} ({pl_sign}{unrealized_plpc:.2f}%)")
                    print()

                print(f"Total Portfolio Value: ${total_value:,.2f}")
                print(f"Total Unrealized P/L: ${total_pl:,.2f}")

            return True

        else:
            print(f"✗ Error fetching positions: HTTP {response.status_code}")
            print(f"Response: {response.text}")
            return False

    except requests.exceptions.RequestException as e:
        print(f"✗ Network error: {e}")
        return False


def test_market_data(api_key, secret_key):
    """Test market data API (optional)."""
    print("\n" + "="*60)
    print("Testing Market Data API (Optional)")
    print("="*60)

    # Market data uses different base URL
    base_url = "https://data.alpaca.markets"

    headers = {
        'APCA-API-KEY-ID': api_key,
        'APCA-API-SECRET-KEY': secret_key
    }

    # Test with a simple quote request for AAPL
    try:
        response = requests.get(
            f"{base_url}/v2/stocks/AAPL/quotes/latest",
            headers=headers
        )

        if response.status_code == 200:
            print("✓ Market data API accessible")
            quote = response.json().get('quote', {})
            if quote:
                print(f"Sample quote (AAPL): Bid ${quote.get('bp', 0):.2f}, Ask ${quote.get('ap', 0):.2f}")
        elif response.status_code == 402:
            print("⚠ Market data requires paid subscription")
            print("  Free tier provides delayed data only")
            print("  This is normal for free accounts")
        else:
            print(f"⚠ Market data API returned HTTP {response.status_code}")
            print("  This won't affect portfolio management functionality")

    except Exception as e:
        print(f"⚠ Could not test market data API: {e}")
        print("  This won't affect portfolio management functionality")


def main():
    """Main test function."""
    print("Alpaca API Connection Test")
    print("="*60)

    # Load credentials
    api_key, secret_key, paper = load_credentials()
    base_url = get_base_url(paper)

    mode = "PAPER TRADING" if paper else "LIVE TRADING"
    print(f"\nMode: {mode}")
    print(f"Base URL: {base_url}")
    print(f"API Key: {api_key[:8]}...{api_key[-4:]}")

    # Run tests
    success = True

    # Test 1: Account info
    if not test_account_info(api_key, secret_key, base_url):
        success = False

    # Test 2: Positions (only if account test passed)
    if success:
        if not test_positions(api_key, secret_key, base_url):
            success = False

    # Test 3: Market data (optional, doesn't affect overall success)
    test_market_data(api_key, secret_key)

    # Summary
    print("\n" + "="*60)
    print("Test Summary")
    print("="*60)

    if success:
        print("✓ All tests passed successfully")
        print("\nYour Alpaca API connection is properly configured.")
        print("The Portfolio Manager skill should work correctly.")
        print("\nNext steps:")
        print("  1. Use Portfolio Manager skill in Claude: 'Analyze my portfolio'")
        print("  2. Review the generated portfolio analysis report")
        print("  3. Follow rebalancing recommendations if provided")
        return 0
    else:
        print("✗ Some tests failed")
        print("\nPlease review the errors above and:")
        print("  1. Verify your API credentials are correct")
        print("  2. Check that ALPACA_PAPER setting matches your API keys")
        print("  3. Ensure your Alpaca account is active and approved")
        print("  4. Check Alpaca API status: https://status.alpaca.markets/")
        print("\nFor help, see: portfolio-manager/references/alpaca-mcp-setup.md")
        return 1


if __name__ == "__main__":
    sys.exit(main())


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)