# Portfolio Management Guide

Build and manage long-term investment portfolios with AI-powered rebalancing.

---

## Overview

While many platform features focus on active trading, the Portfolio Management tools are designed for:

- **Fund managers** running diversified portfolios
- **Long-term investors** with buy-and-hold strategies
- **Position traders** with multi-week horizons
- **Anyone** managing multiple assets together

---

## Strategy Horizons

Every strategy has a time horizon that affects how it operates:

| Horizon | Typical Hold Time | Best For |
|---------|-------------------|----------|
| **Intraday** | Minutes to hours | Day trading |
| **Swing** | Days to 2 weeks | Momentum plays |
| **Position** | 2 weeks to 3 months | Trend following |
| **Long-Term** | 3+ months | Value investing |

### Choosing Your Horizon
1. When creating a strategy, select the horizon
2. The system adjusts defaults accordingly:
   - Risk parameters
   - Rebalancing frequency
   - Indicator timeframes

---

## Creating a Portfolio Strategy

### Step 1: Define Your Universe
Select which assets to include:

- **Manual Selection** — Pick specific symbols
- **Screener** — Filter by criteria (market cap, sector, etc.)
- **Preset** — Use pre-built universes (S&P 500, Tech Leaders, etc.)

### Step 2: Set Allocation Weights

**Equal Weight**:
- Same percentage in each asset
- Simple, automatic diversification

**Custom Weights**:
- Specify exact percentage per asset
- Total must equal 100%

**Factor-Based**:
- Weight by market cap, momentum, value, etc.
- AI optimizes allocations

### Step 3: Define Rebalancing Rules

**Time-Based**:
- Rebalance on schedule (weekly, monthly, quarterly)
- Set specific day and time

**Drift-Based**:
- Rebalance when allocations drift from targets
- Set drift threshold (e.g., 5%)

**Combined**:
- Check on schedule AND when drift exceeds threshold
- Most common approach

---

## Fundamental Filters

For long-term strategies, filter by company fundamentals:

### Valuation Metrics
| Metric | Description | Typical Use |
|--------|-------------|-------------|
| P/E Ratio | Price to Earnings | Lower = potentially undervalued |
| P/B Ratio | Price to Book | Lower = value stocks |
| EV/EBITDA | Enterprise value efficiency | Compare within sector |

### Quality Metrics
| Metric | Description | Typical Use |
|--------|-------------|-------------|
| ROE | Return on Equity | Higher = efficient use of capital |
| ROA | Return on Assets | Higher = efficient operations |
| Debt/Equity | Leverage ratio | Lower = less risky |

### Growth Metrics
| Metric | Description | Typical Use |
|--------|-------------|-------------|
| EPS Growth | Earnings per share growth | Higher = growing company |
| Revenue Growth | Top-line growth | Higher = expanding business |

### Dividend Metrics
| Metric | Description | Typical Use |
|--------|-------------|-------------|
| Dividend Yield | Annual dividend / price | Income generation |
| Payout Ratio | % of earnings paid as dividends | Sustainability check |

### Using Fundamental Filters
Example: "Include stocks where P/E < 20 AND ROE > 15% AND Debt/Equity < 1"

---

## Portfolio Backtesting

Test your portfolio strategy against history.

### What's Measured

**Performance Metrics**:
| Metric | What It Shows |
|--------|---------------|
| Total Return | Overall gain/loss |
| CAGR | Compound Annual Growth Rate |
| Sharpe Ratio | Risk-adjusted return |
| Sortino Ratio | Downside-adjusted return |

**Risk Metrics**:
| Metric | What It Shows |
|--------|---------------|
| Max Drawdown | Worst peak-to-trough decline |
| Volatility | Standard deviation of returns |
| Beta | Correlation to market |
| VaR (95%) | Expected worst-case loss |

**Diversification Metrics**:
| Metric | What It Shows |
|--------|---------------|
| Concentration (HHI) | How concentrated the portfolio is |
| Correlation | How assets move together |
| Sector Exposure | Breakdown by sector |

### Running a Backtest
1. Configure your portfolio strategy
2. Click **Backtest**
3. Select time period (1-10 years)
4. Review results

### Interpreting Results
- **Good Sharpe**: > 1.0 (> 1.5 is excellent)
- **Acceptable Max Drawdown**: < 25% for long-term
- **Diversification**: Lower HHI is better

---

## Rebalancing

### Automatic Rebalancing
The system can rebalance automatically:

1. **Monitor** — Track allocations vs. targets
2. **Alert** — Notify when drift exceeds threshold
3. **Execute** — Place trades to realign (if enabled)

### Rebalancing Methods

**Threshold Rebalancing**:
- Rebalance when any position drifts X% from target
- Common threshold: 5%

**Calendar Rebalancing**:
- Rebalance on fixed schedule
- Monthly or quarterly most common

**Band Rebalancing**:
- Only rebalance positions outside a band
- Example: Target 10%, band 8-12%

### Tax Considerations
- Consider tax implications of selling
- Tax-loss harvesting opportunities flagged
- View unrealized gains/losses before rebalancing

---

## Monitoring Your Portfolio

### Dashboard View
- Current allocations vs. targets
- Performance since inception
- Drift indicators
- Upcoming rebalancing dates

### Alerts
Set alerts for:
- Drift exceeding threshold
- Position hitting stop loss
- Fundamental changes (earnings, dividends)
- Corporate actions

### Reports
- **Performance Report** — Returns, attribution
- **Risk Report** — Exposure analysis
- **Tax Report** — Realized/unrealized gains

---

## Risk Management for Portfolios

### Position Limits
- Maximum per position (e.g., 10%)
- Maximum per sector (e.g., 30%)
- Minimum diversification (e.g., 10+ positions)

### Stop Losses
For portfolio positions:
- Individual position stops
- Portfolio-level stop (total portfolio value)

### Hedging
Add defensive positions:
- Cash allocation
- Bond allocation
- Inverse ETFs (advanced)

---

## Holding Period Enforcement

For long-term strategies, prevent premature selling.

### How It Works
1. Set minimum holding period per horizon
2. System prevents exits before period ends
3. Exceptions for stop losses

### Default Periods
| Horizon | Minimum Hold |
|---------|--------------|
| Intraday | None |
| Swing | 1 day |
| Position | 7 days |
| Long-Term | 30 days |

---

## Example Portfolio Strategies

### Value Portfolio
- **Universe**: S&P 500
- **Filters**: P/E < 15, Dividend Yield > 2%, Debt/Equity < 0.5
- **Weights**: Equal weight top 20
- **Rebalance**: Quarterly

### Growth Portfolio
- **Universe**: NASDAQ 100
- **Filters**: Revenue Growth > 20%, ROE > 15%
- **Weights**: Market cap weighted top 15
- **Rebalance**: Monthly

### Dividend Income
- **Universe**: Dividend Aristocrats
- **Filters**: Yield > 3%, Payout Ratio < 60%
- **Weights**: Yield-weighted
- **Rebalance**: Quarterly

### Balanced 60/40
- **Allocation**: 60% stocks (SPY), 40% bonds (BND)
- **Rebalance**: When drift > 5%

---

## Best Practices

### Do
- Diversify across sectors and asset classes
- Rebalance regularly but not too frequently
- Consider transaction costs
- Review fundamentals periodically
- Have a clear investment thesis

### Don't
- Over-concentrate in one position
- Chase performance
- Ignore tax implications
- Rebalance too frequently (costs add up)
- Abandon strategy during drawdowns

---

## Troubleshooting

### Rebalancing Not Executing
- Check broker connection
- Verify sufficient buying power
- Review minimum trade size settings

### Fundamental Data Missing
- Some metrics only available for stocks (not ETFs/crypto)
- Data updates with ~4 hour delay
- Check if ticker is correctly recognized

### Performance Mismatch
- Ensure dividends are included/excluded as expected
- Check fee assumptions
- Verify benchmark is correct

---

## Next Steps

1. **Create a test portfolio** with a few positions
2. **Backtest** against historical data
3. **Run in paper mode** to validate rebalancing
4. **Go live** when comfortable with behavior

---

*Past performance does not guarantee future results. Diversification does not ensure profit or protect against loss.*
