Communitygithub.com

Portfolio Manager Agent - Portfoliomanager

Optimiert die Portfolioallokation und das Rebalancing. Verwaltet die Vermögensaufteilung in Aktien/Bargeld/Anleihen, führt regelmäßiges Rebalancing durch und stellt die Diversifikation in Abhängigkeit vom Marktregime und der Risikotoleranz sicher.

Was ist Portfolio Manager Agent - Portfoliomanager?

Dieses Skill für KI-Agenten, optimiert für Claude Code, Cursor und Codex, implementiert einen Portfoliomanager, der die Vermögensallokation dynamisch an das Marktregime anpasst. Es analysiert die aktuelle Portfoliozusammensetzung, erkennt das Marktregime (RISK_ON, RISK_OFF, TRANSITION) mittels eines integrierten Marktregime-Detektors und berechnet die optimale Zielallokation. Die Kernkompetenzen umfassen die dynamische Asset-Allokation, deren Schwellenwerte für ein Rebalancing (Abweichung > 5 %), die Überwachung von Risikokennzahlen (Beta, Sharpe Ratio, Maximaler Verlust) und die Positionierung basierend auf der modifizierten Kelly-Formel. Der Agent generiert konkrete Handelsvorschläge, dokumentiert seine Entscheidungen in einem standardisierten JSON-Format und beachtet dabei konstitutionelle Grenzen (z. B. maximale Sektor- und Einzelpositionen). Ziel ist es, die Rendite im Verhältnis zum Risiko durch systematisches, regelbasiertes Rebalancing zu maximieren und übermäßige Transaktionskosten sowie emotionale Entscheidungen zu vermeiden.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/diegosouzapw/awesome-omni-skill/tree/HEAD/skills/development/portfolio-manager-agent

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Portfolio Manager Agent - Portfoliomanager?

Rolle

Optimiert die Rendite im Verhältnis zum Risiko, indem sie die Vermögensallokation, das Rebalancing und die Diversifikation des Portfolios verwaltet.

Kernkompetenzen

1. Asset-Allokationsstrategie

Dynamische Allokation nach Marktregime

# RISK_ON (Konjunkturaufschwung, VIX < 20)
allocation = {
    'stocks': 0.70,
    'bonds': 0.20,
    'cash': 0.10
}

# RISK_OFF (Konjunkturabschwung, VIX > 25)
allocation = {
    'stocks': 0.40,
    'bonds': 0.40,
    'cash': 0.20
}

# TRANSITION (Übergangsphase, VIX 20-25)
allocation = {
    'stocks': 0.55,
    'bonds': 0.30,
    'cash': 0.15
}

Sektordiversifikation

Technologie: Maximal 40 %
Finanzen: Maximal 30 %
Gesundheitswesen: Maximal 25 %
Andere Sektoren: Jeweils maximal 20 %

2. Rebalancing-Auslöser

WENN Abweichung > 5 %:
  → Rebalancing empfohlen

Beispiel:
Ziel: Aktien 70 %
Aktuell: Aktien 76 %
Abweichung: +6 % → REBALANCING

WENN Abweichung > 10 %:
  → Dringendes Rebalancing
  → Sofortige Benachrichtigung

3. Überwachung von Risikokennzahlen

  • Portfolio-Beta: Volatilität im Vergleich zum Markt
  • Sharpe Ratio: Rendite im Verhältnis zum Risiko
  • Maximaler Verlust: Größter Kursrückgang
  • Korrelationsmatrix: Korrelationen zwischen den Positionen

4. Positionsgrößenbestimmung

# Kelly-Kriterium (modifiziert)
position_size = (win_rate * avg_win - (1 - win_rate) * avg_loss) / avg_win

# Positionslimits
position_size = min(position_size, MAX_SINGLE_POSITION)  # 15 %

Entscheidungsrahmen

Schritt 1: Analysiere aktuelles Portfolio
  - Aktuelle Allokation
  - Einzelpositionen
  - Sektoraufteilung
  - Risikokennzahlen

Schritt 2: Erkenne Marktregime
  von backend.ai.market_regime import MarketRegimeDetector
  regime = detector.detect_regime(market_data)

Schritt 3: Bestimme Zielallokation
  Basierend auf Regime:
    - RISK_ON → Aggressiv (70/20/10)
    - RISK_OFF → Konservativ (40/40/20)
    - TRANSITION → Ausgewogen (55/30/15)

Schritt 4: Berechne Abweichung
  deviation = |aktuell - ziel|

Schritt 5: Entscheidung über Rebalancing
  WENN Abweichung > Schwelle:
    → Generiere Rebalancing-Transaktionen
  SONST:
    → Behalte aktuelle Allokation bei

Schritt 6: Wende konstitutionelle Grenzen an
  - Prüfe Einhaltung von Artikel 4
  - Stelle Positionslimits sicher
  - Überprüfe Sektorlimits

Ausgabeformat

{
  "agent": "portfolio_manager",
  "recommendation": "REBALANCE|HOLD",
  "confidence": 0.85,
  "reasoning": "Umschwung auf Marktregime RISK_OFF, Aktienquote muss reduziert werden",
  "current_allocation": {
    "stocks": 0.76,
    "bonds": 0.18,
    "cash": 0.06,
    "total_value_usd": 100000
  },
  "target_allocation": {
    "stocks": 0.55,
    "bonds": 0.30,
    "cash": 0.15
  },
  "deviation": {
    "stocks": 0.21,
    "bonds": -0.12,
    "cash": -0.09,
    "max_deviation": 0.21
  },
  "rebalancing_trades": [
    {
      "action": "SELL",
      "asset_class": "stocks",
      "amount_usd": 21000,
      "reason": "Aktienquote von 76 % auf 55 % anpassen"
    },
    {
      "action": "BUY",
      "asset_class": "bonds",
      "amount_usd": 12000,
      "reason": "Anleihenquote von 18 % auf 30 % erhöhen"
    },
    {
      "action": "INCREASE",
      "asset_class": "cash",
      "amount_usd": 9000,
      "reason": "Bargeldquote erhöhen (defensive Position)"
    }
  ],
  "risk_analysis": {
    "portfolio_beta": 1.15,
    "sharpe_ratio": 1.45,
    "max_drawdown": -0.08,
    "expected_volatility": 0.18
  },
  "sector_breakdown": {
    "Technology": 0.35,
    "Finance": 0.20,
    "Healthcare": 0.15,
    "Other": 0.30
  },
  "next_review_date": "2025-12-28"
}

Beispiele

Beispiel 1: RISK_ON → Aggressive Allokation

Eingabe:
- VIX: 15
- BIP-Wachstum: 3,0 %
- Marktregime: RISK_ON
- Aktuell: Aktien 55 %, Anleihen 30 %, Bargeld 15 %

Ausgabe:
- Empfehlung: REBALANCE
- Ziel: Aktien 70 %, Anleihen 20 %, Bargeld 10 %
- Transaktionen:
  * KAUF Aktien $15.000
  * VERKAUF Anleihen $10.000
  * REDUZIERUNG Bargeld $5.000

Beispiel 2: RISK_OFF → Defensive Allokation

Eingabe:
- VIX: 28
- Rezessionssignale
- Marktregime: RISK_OFF
- Aktuell: Aktien 70 %, Anleihen 20 %, Bargeld 10 %

Ausgabe:
- Empfehlung: URGENT_REBALANCE
- Ziel: Aktien 40 %, Anleihen 40 %, Bargeld 20 %
- Transaktionen:
  * VERKAUF Aktien $30.000
  * KAUF Anleihen $20.000
  * ERHÖHUNG Bargeld $10.000

Beispiel 3: Kleine Abweichung → Halten

Eingabe:
- Aktuell: Aktien 68 %, Anleihen 22 %, Bargeld 10 %
- Ziel: Aktien 70 %, Anleihen 20 %, Bargeld 10 %
- Abweichung: 2 %, 2 %, 0 %

Ausgabe:
- Empfehlung: HOLD
- Begründung: "Abweichung < 5 %, Beibehalten unter Berücksichtigung der Transaktionskosten vorteilhaft"

Beispiel 4: Sektor-Rebalancing

Eingabe:
- Technologie: 45 % (MAX 40 %)
- Finanzen: 15 %
- Gesundheitswesen: 10 %

Ausgabe:
- Empfehlung: SECTOR_REBALANCE
- Transaktionen:
  * VERKAUF Technologieaktien $5.000 (45 % → 40 %)
  * KAUF Gesundheitswesen $3.000
  * KAUF Finanzen $2.000

Richtlinien

Gebote ✅

  • Regelmäßige Überprüfung: Wöchentliche oder vierzehntägige Überwachung
  • Marktregime priorisieren: Allokation basierend auf dem makroökonomischen Umfeld
  • Schrittweises Rebalancing: Abrupte Änderungen vermeiden
  • Steuereffizienz: Steueroptimiertes Rebalancing

Verbote ❌

  • Übermäßigen Handel vermeiden (Transaktionskosten berücksichtigen)
  • Keine Überreaktion auf kurzfristige Volatilität
  • Keine emotionalen Allokationsänderungen
  • Keine Verstöße gegen Artikel 4 der Verfassung

Integration mit dem Marktregime-Detektor

from backend.ai.market_regime import MarketRegimeDetector
from backend.ai.regime_detector import detect_market_regime

detector = MarketRegimeDetector()

regime_data = {
    'vix': 18,
    'yield_curve_10y2y': 0.3,
    'fed_stance': 'neutral',
    'gdp_growth': 0.025,
    'unemployment': 0.038,
    'cpi': 0.028
}

regime = detector.detect_regime(regime_data)

# Ausgabe:
# {
#   "current_regime": "RISK_ON",
#   "confidence": 0.75,
#   "recommended_asset_allocation": {
#     "stocks": 0.70,
#     "bonds": 0.20,
#     "cash": 0.10
#   },
#   "regime_indicators": {
#     "vix_signal": "LOW_VOLATILITY",
#     "yield_curve_signal": "NORMAL",
#     "macro_signal": "EXPANSION"
#   }
# }

Rebalancing-Algorithmus

Schwellenbasiertes Rebalancing

def check_rebalancing_needed(
    current: Dict[str, float],
    target: Dict[str, float],
    threshold: float = 0.05
) -> bool:
    """Überprüft, ob ein Rebalancing erforderlich ist"""
    
    for asset_class in target.keys():
        deviation = abs(current[asset_class] - target[asset_class])
        
        if deviation > threshold:
            return True
    
    return False

# Beispiel
current = {'stocks': 0.76, 'bonds': 0.18, 'cash': 0.06}
target = {'stocks': 0.70, 'bonds': 0.20, 'cash': 0.10}

needs_rebalance = check_rebalancing_needed(current, target)  # True

Optimale Handelsberechnung

def calculate_rebalancing_trades(
    current_allocation: Dict[str, float],
    target_allocation: Dict[str, float],
    total_portfolio_value: float
) -> List[Dict]:
    """Berechnet optimale Transaktionen für das Rebalancing"""
    
    trades = []
    
    for asset_class, target_pct in target_allocation.items():
        current_pct = current_allocation[asset_class]
        current_value = current_pct * total_portfolio_value
        target_value = target_pct * total_portfolio_value
        
        diff = target_value - current_value
        
        if abs(diff) > 1000:  # Mindesthandel $1.000
            action = "BUY" if diff > 0 else "SELL"
            trades.append({
                "asset_class": asset_class,
                "action": action,
                "amount_usd": abs(diff),
                "from_pct": current_pct,
                "to_pct": target_pct
            })
    
    return trades

Leistungskennzahlen

  • Rebalancing-Häufigkeit: Ziel: 1-2 Mal pro Monat
  • Transaktionskosten: < 0,5 % des Portfoliowerts
  • Verbesserung der Sharpe Ratio: Ziel: +10 % gegenüber Halten
  • Verlustreduzierung: Ziel: -20 % gegenüber unverwaltetem Portfolio

Verfassungskonformität

from backend.constitution import Constitution

constitution = Constitution()

# Rebalancing-Transaktionen validieren
for trade in rebalancing_trades:
    # Prüfen, ob die neue Allokation gegen Artikel 4 verstößt
    new_allocation = apply_trade(current_allocation, trade)
    
    is_valid, violations, _ = constitution.validate_allocation(
        new_allocation,
        current_positions
    )
    
    if not is_valid:
        # Transaktion zur Einhaltung anpassen
        trade = adjust_trade_for_compliance(trade, violations)

Risikoadjustierte Positionsgrößenbestimmung

Integration der Modernen Portfoliotheorie (MPT)

import numpy as np
from scipy.optimize import minimize

def optimize_portfolio(
    returns: np.array,
    covariance: np.array,
    risk_free_rate: float = 0.03
) -> np.array:
    """Optimiert das Portfolio mittels MPT"""
    
    n_assets = len(returns)
    
    # Ziel: Maximierung der Sharpe Ratio
    def objective(weights):
        portfolio_return = np.dot(weights, returns)
        portfolio_std = np.sqrt(np.dot(weights, np.dot(covariance, weights)))
        sharpe = (portfolio_return - risk_free_rate) / portfolio_std
        return -sharpe  # Minimierung der negativen Sharpe Ratio
    
    # Nebenbedingungen
    constraints = [
        {'type': 'eq', 'fun': lambda w: np.sum(w) - 1},  # Summe = 1
        {'type': 'ineq', 'fun': lambda w: w}  # Nicht-negativ
    ]
    
    # Grenzen (maximal 15 % pro Aktie)
    bounds = tuple((0, 0.15) for _ in range(n_assets))
    
    # Startschätzung
    x0 = np.array([1/n_assets] * n_assets)
    
    # Optimierung
    result = minimize(objective, x0, method='SLSQP', bounds=bounds, constraints=constraints)
    
    return result.x

Zusammenarbeit mit anderen Agenten

War Room → Handelssignale
  ↓
Portfoliomanager → Aktuelle Allokation prüfen
  ↓
WENN neue Position zu Ungleichgewicht führt:
  → Teilweise Positionsgröße vorschlagen
  ODER
  → Empfehlen, zuerst andere Positionen zu verkaufen

Beispiel:
War Room: KAUF AAPL $15.000
Portfoliomanager: "Technologiesektor bereits bei 38 %, kaufe nur $10.000"

Berichterstattung

Wöchentlicher Portfoliobericht

# Portfolio Performance Report - Woche vom 21.12.2025

## Vermögensallokation
- Aktien: 68 % (Ziel: 70 %) ✓
- Anleihen: 22 % (Ziel: 20 %) ⚠️
- Bargeld: 10 % (Ziel: 10 %) ✓

## Performance
- Wochenrendite: +2,3 %
- Rendite seit Jahresbeginn: +15,7 %
- Sharpe Ratio: 1,45
- Maximaler Verlust: -8,2 %

## Ergriffene Maßnahmen
- Keine (innerhalb der Toleranz)

## Nächste Überprüfung: 28.12.2025

Versionsverlauf

  • v1.0 (21.12.2025): Erste Veröffentlichung mit MPT-Optimierung und Marktregime-Integration

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

diegosouzapw/awesome-omni-skill

Build a GitHub portfolio that gets you hired — curate 3-5 polished projects, craft compelling READMEs, deploy live demos, tell a coherent story across your repos, and align everything to AI-native development roles. Use when preparing your GitHub for job searches, deciding what to pin, or auditing your public presence.

diegosouzapw/awesome-omni-skill

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

diegosouzapw/awesome-omni-skill

Factor modeling and portfolio construction (Markowitz, Black-Litterman, constraints, turnover).

diegosouzapw/awesome-omni-skill

Analyze the CustomGPT.ai Labs Innovation workbook and cost tracking data to surface portfolio-level insights, trends, and recommendations for where to focus Innovation efforts.

diegosouzapw/awesome-omni-skill

Optimize project portfolio selection under constraints using mathematical optimization

diegosouzapw/awesome-omni-skill

Rapidly build, prototype, and deploy full-stack software using AI "text-to-app" tools. Use this when you need to create a greenfield application, build a high-fidelity working prototype for user testing, or bypass traditional engineering bottlenecks for internal tools.

diegosouzapw/awesome-omni-skill

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios,...

diegosouzapw/awesome-omni-skill

Minimalist, typography-focused portfolio design system inspired by neo-brutalist and Swiss design principles. Emphasizes bold typography, generous whitespace, monochromatic color schemes, and elegant simplicity for developer/designer portfolios.

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

High-converting landing pages. Copy + design + implementation. Triggers: landing page, conversion page.

diegosouzapw/awesome-omni-skill

Detect and explain risk drift in lending portfolios over time using vintage analysis, migration matrices, and concentration metrics. Use when monitoring portfolio credit quality trends, preparing board risk reports, conducting stress testing, or when risk metrics deviate from appetite thresholds.

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

Index-based file discovery using ABOUTME headers. Use INSTEAD of grep or Explore agent when searching for files by purpose or feature. Faster and more accurate than scanning code. Invoke this skill when user asks "which files handle X", "where is Y implemented", or when you need to find files related to a feature or task.

diegosouzapw/awesome-omni-skill

Index-based file discovery using ABOUTME headers. Use INSTEAD of grep or Explore agent when searching for files by purpose or feature. Faster and more accurate than scanning code. Invoke this skill when user asks "which files handle X", "where is Y implemented", or when you need to find files related to a feature or task.

diegosouzapw/awesome-omni-skill

Automate Klipfolio tasks via Rube MCP (Composio). Always search tools first for current schemas.

diegosouzapw/service-website-generator

Orchestrates automated service-based website generation with local SEO optimization. Creates 200+ service+location pages using parallel agents, Unsplash images via Jina AI, NextJS with dynamic routing, and PostgreSQL database. Use when building service business websites (plumbers, electricians, pressure washing, HVAC, etc.) targeting multiple locations.

Verwandte Skills