portfolio-management
Manages investment portfolios with quantitative models, risk metrics, and optimization algorithms.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o portfolio-management.zip https://jpskill.com/download/22215.zip && unzip -o portfolio-management.zip && rm portfolio-management.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22215.zip -OutFile "$d\portfolio-management.zip"; Expand-Archive "$d\portfolio-management.zip" -DestinationPath $d -Force; ri "$d\portfolio-management.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
portfolio-management.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
portfolio-managementフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
portfolio-management
目的
このスキルは、AIが定量的モデルを使用して投資ポートフォリオを管理し、Value at Risk (VaR) のようなリスク指標を計算し、平均分散最適化などの最適化アルゴリズムを適用することを可能にします。ポートフォリオデータを処理して実用的な洞察を生成し、データソースと統合し、事前定義された戦略に基づいて取引を実行することで、金融における意思決定をサポートします。
使用場面
このスキルは、金融におけるポートフォリオのリバランス、リスク評価、またはパフォーマンス分析を含むタスクに使用します。資産の多様化や市場の変動への対応など、投資戦略に関するユーザーのクエリを処理する際に適用します。リアルタイムのデータフィードがあるシナリオや、予算制限などの制約の下で配分を最適化する場合に最適です。
主要な機能
- 定量的モデル: CAPMやBlack-Littermanなどのモデルを実装します。例:
claw portfolio model capm --assets AAPL,GOOGで期待リターンを計算します。 - リスク指標: VaRやシャープレシオを計算します。APIエンドポイント
GET /api/portfolios/risk/var?confidence=0.95を使用して、ポートフォリオの95% VaRを取得します。 - 最適化アルゴリズム: 平均分散最適化を実行します。JSONファイルで設定します:
{"assets": ["AAPL", "MSFT"], "weights": [0.5, 0.5]}。 - データ統合: 外部APIから市場データを取得します。ポートフォリオ入力としてCSVやJSONなどの形式をサポートします。
- パフォーマンス追跡: ポートフォリオのリターンに関するレポートを生成します。例:
claw portfolio track --period monthly --metric sharpe。
使用パターン
常に $PORTFOLIO_API_KEY 環境変数による認証で初期化します。CLIの使用では、データ入力を直接パイプします。例: claw portfolio load --file portfolio.json で開始し、claw portfolio optimize --risk-level high のようにコマンドを連結します。APIパターンでは、変更にはPOSTリクエストを、クエリにはGETリクエストを使用します。エンドポイントをポーリングすることで非同期操作を処理します。スクリプトの場合、APIの失敗を管理するためにtry-catchブロックでラップし、資産リストなどの再利用可能なパラメータには設定ファイルを使用します。
一般的なコマンド/API
- CLIコマンド:
claw portfolio manage --action optimize --config config.jsonを使用してポートフォリオを最適化します。フラグには--action(optimize, analyze)、--config(JSONへのパス)、詳細なログのための--verboseが含まれます。 - APIエンドポイント:
POST /api/portfolios/createにボディ{"name": "my-portfolio", "assets": ["AAPL", "TSLA"]}を付けてリクエストを送信します。ヘッダーAuthorization: Bearer $PORTFOLIO_API_KEYで認証します。 - コードスニペット:
import requests response = requests.post('https://api.openclaw.ai/api/portfolios/optimize', headers={'Authorization': f'Bearer {os.environ["PORTFOLIO_API_KEY"]}'}, json={'assets': ['AAPL', 'GOOG']}) print(response.json()['optimized_weights'])claw portfolio analyze --assets AAPL,MSFT --metric var --confidence 0.99 - 設定形式: 入力にはJSONを使用します。例:
{"portfolio": {"assets": [{"symbol": "AAPL", "quantity": 100}], "constraints": {"max_risk": 0.05}}}。claw portfolio validate --file config.jsonで検証します。
統合に関する注意点
コマンドを実行する前に、環境変数に $PORTFOLIO_API_KEY を設定して統合します。外部システムの場合、Webhooksを使用してデータを同期します。例: POST /api/portfolios/update のようなエンドポイントをマッピングして更新をトリガーすることで、証券会社のAPIに接続します。計算にはNumPyのような金融ライブラリとの互換性を確保します。Pythonスクリプトではモジュールとしてインポートし、API呼び出し間に time.sleep(1) のような遅延を追加してレート制限を処理します。モックデータを使用してサンドボックス環境で統合をテストします。
エラー処理
$PORTFOLIO_API_KEY が設定されていることを確認して認証エラーをチェックします。不足している場合は、os.environ.get('PORTFOLIO_API_KEY') or raise ValueError("API key required") でユーザーにプロンプトを表示します。APIの失敗については、コード内でtry-exceptを使用して401や429のようなHTTPエラーを捕捉します。
try:
response = requests.get('https://api.openclaw.ai/api/portfolios/risk')
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.status_code} - {e.response.text}")
claw portfolio validate で最初に設定を検証することで無効な入力を処理します。--log-file errors.log フラグを使用してエラーをファイルに記録し、指数バックオフで一時的なエラーを最大3回再試行します。
グラフの関係
- クラスターに関連: financial
- タグで接続: finance, investments, risk-management, quant-analysis
- 他のスキルへのリンク: データ処理のために data-analysis に依存します。自動取引のために trading-execution を強化します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
portfolio-management
Purpose
This skill enables the AI to manage investment portfolios using quantitative models, calculate risk metrics like Value at Risk (VaR), and apply optimization algorithms such as mean-variance optimization. It processes portfolio data to generate actionable insights, supporting decisions in finance by integrating with data sources and executing trades based on predefined strategies.
When to Use
Use this skill for tasks involving portfolio rebalancing, risk assessment, or performance analysis in financial contexts. Apply it when handling user queries about investment strategies, such as diversifying assets or responding to market volatility. Ideal for scenarios with real-time data feeds or when optimizing allocations under constraints like budget limits.
Key Capabilities
- Quantitative Models: Implement models like CAPM or Black-Litterman; e.g., calculate expected returns with
claw portfolio model capm --assets AAPL,GOOG. - Risk Metrics: Compute VaR or Sharpe ratio; use API endpoint
GET /api/portfolios/risk/var?confidence=0.95to get 95% VaR for a portfolio. - Optimization Algorithms: Run mean-variance optimization; configure via JSON file:
{"assets": ["AAPL", "MSFT"], "weights": [0.5, 0.5]}. - Data Integration: Pull market data from external APIs; supports formats like CSV or JSON for portfolio inputs.
- Performance Tracking: Generate reports on portfolio returns; e.g.,
claw portfolio track --period monthly --metric sharpe.
Usage Patterns
Always initialize with authentication via $PORTFOLIO_API_KEY environment variable. For CLI usage, pipe data inputs directly; e.g., start with claw portfolio load --file portfolio.json then chain commands like claw portfolio optimize --risk-level high. In API patterns, use POST requests for modifications and GET for queries; handle asynchronous operations by polling endpoints. For scripts, wrap in try-catch blocks to manage API failures, and use config files for reusable parameters like asset lists.
Common Commands/API
- CLI Commands: Use
claw portfolio manage --action optimize --config config.jsonto optimize a portfolio; flags include--action(optimize, analyze),--config(path to JSON), and--verbosefor detailed logs. - API Endpoints: Send requests to
POST /api/portfolios/createwith body{"name": "my-portfolio", "assets": ["AAPL", "TSLA"]}; authenticate via headerAuthorization: Bearer $PORTFOLIO_API_KEY. - Code Snippets:
import requests response = requests.post('https://api.openclaw.ai/api/portfolios/optimize', headers={'Authorization': f'Bearer {os.environ["PORTFOLIO_API_KEY"]}'}, json={'assets': ['AAPL', 'GOOG']}) print(response.json()['optimized_weights'])claw portfolio analyze --assets AAPL,MSFT --metric var --confidence 0.99 - Config Formats: Use JSON for inputs, e.g.,
{"portfolio": {"assets": [{"symbol": "AAPL", "quantity": 100}], "constraints": {"max_risk": 0.05}}}; validate withclaw portfolio validate --file config.json.
Integration Notes
Integrate by setting $PORTFOLIO_API_KEY in your environment before running commands. For external systems, use webhooks to sync data; e.g., connect to a brokerage API by mapping endpoints like POST /api/portfolios/update to trigger updates. Ensure compatibility with financial libraries like NumPy for calculations; import as a module in Python scripts and handle rate limits by adding delays, e.g., time.sleep(1) between API calls. Test integrations in a sandbox environment using mock data.
Error Handling
Check for authentication errors by verifying $PORTFOLIO_API_KEY is set; if missing, prompt user with os.environ.get('PORTFOLIO_API_KEY') or raise ValueError("API key required"). For API failures, catch HTTP errors like 401 or 429 using try-except in code:
try:
response = requests.get('https://api.openclaw.ai/api/portfolios/risk')
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.status_code} - {e.response.text}")
Handle invalid inputs by validating configs first with claw portfolio validate; log errors to file with --log-file errors.log flag, and retry transient errors up to 3 times with exponential backoff.
Graph Relationships
- Related to cluster: financial
- Connected via tags: finance, investments, risk-management, quant-analysis
- Links to other skills: depends on data-analysis for data processing; enhances trading-execution for automated trades