技能详情(站内镜像,无评论)
作者:RunByDaVinci @clawdiri-ai
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v0.1.0
统计:⭐ 0 · 28 · 0 current installs · 0 all-time installs
⭐ 0
安装量(当前) 0
🛡 VirusTotal :良性 · OpenClaw :良性
Package:clawdiri-ai/einstein-research-portfolio-risk-dv
安全扫描(ClawHub)
- VirusTotal :良性
- OpenClaw :良性
OpenClaw 评估
The skill is internally coherent for a portfolio risk analyzer: included Python code and documentation match the described features, it uses Yahoo Finance via yfinance for data, and it does not request unrelated credentials or hidden network endpoints.
综合结论
This package appears to implement the risk analyses it claims and does not ask for unrelated credentials, but consider the following before installing or running: - The script requires Python plus yfinance/numpy/pandas/scipy; install packages from PyPI in a controlled environment (virtualenv). - The SKILL.md references a CLI name that isn't provided; run the included script (python3 scripts/portfolio_risk.py) per README. - The script fetches d…
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Einstein Research — Portfolio Risk Analyzer」。简介:Performs a comprehensive, portfolio-level risk analysis. Calculates VaR (Value …。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/clawdiri-ai/einstein-research-portfolio-risk-dv/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
---
id: 'einstein-research-portfolio-risk'
name: 'Einstein Research — Portfolio Risk Analyzer'
description: 'Performs a comprehensive, portfolio-level risk analysis. Calculates VaR (Value at Risk), max drawdown, correlation matrix, stress tests against historical crises, and identifies concentration risks. Use when asked about portfolio risk, drawdown, hedging, or stress testing.'
version: '1.0.0'
author: 'DaVinci'
last_amended_at: null
trigger_patterns: []
pre_conditions:
git_repo_required: false
tools_available: []
expected_output_format: 'natural_language'
---
# Portfolio Risk Analyzer
## Overview
This skill performs a comprehensive, portfolio-level risk analysis. It goes beyond individual position risk to quantify systemic and correlated risks across the entire portfolio.
**Core Features:**
- **Value at Risk (VaR)**: Calculates 95% and 99% VaR using Parametric, Historical, and Monte Carlo methods.
- **Max Drawdown Analysis**: Identifies historical and potential future maximum drawdowns.
- **Correlation Matrix**: Visualizes how positions move in relation to each other, highlighting diversification benefits or weaknesses.
- **Stress Testing**: Simulates portfolio performance during historical market crises (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hikes).
- **Concentration Risk**: Identifies over-concentration in specific sectors, factors, or individual positions.
- **Beta Calculation**: Measures portfolio volatility relative to benchmarks (SPY, QQQ).
---
## When to Use This Skill
**Explicit Triggers:**
- "Analyze the risk of my portfolio."
- "What is my portfolio's Value at Risk?"
- "How would my portfolio perform in another 2008-style crash?"
- "Am I too concentrated in the tech sector?"
- "Calculate the max drawdown of my holdings."
- User asks about "portfolio risk," "drawdown," "VaR," "correlation," "stress test," or "concentration."
**Implicit Triggers:**
- User is concerned about a market downturn.
- User is adding a new large position and wants to understand its impact on overall portfolio risk.
- User is reviewing their overall asset allocation.
---
## Workflow
### Step 1: Ingest Portfolio Data
The analysis requires the current portfolio holdings, typically from a CSV or JSON file.
**Input Format (`portfolio.json`):**
```json
{
"positions": [
{ "ticker": "AAPL", "quantity": 100, "avg_price": 150.00 },
{ "ticker": "TSLA", "quantity": 50, "avg_price": 200.00 },
{ "ticker": "SPY", "quantity": 200, "avg_price": 400.00 }
],
"cash": 25000
}
```
### Step 2: Execute the Risk Analysis Script
The `portfolio-risk-analyzer` CLI tool runs the full analysis suite.
```bash
portfolio-risk-analyzer run
--portfolio path/to/portfolio.json
--benchmark SPY
```
The script performs the following calculations:
1. Fetches historical price data for all positions.
2. Calculates daily returns for each position and the total portfolio.
3. **VaR**:
- *Parametric*: Assumes normal distribution of returns.
- *Historical*: Uses the actual distribution of historical returns.
- *Monte Carlo*: Simulates thousands of possible future return paths.
4. **Max Drawdown**: Finds the largest peak-to-trough decline in the portfolio's history.
5. **Correlation**: Computes the correlation matrix for all positions.
6. **Stress Tests**: Re-prices the portfolio based on the returns of historical crisis periods.
7. **Concentration**: Calculates weights by position, sector, and factor.
### Step 3: Analyze the Output
The script generates a detailed report in both JSON and Markdown formats.
**JSON Output (`risk_report_YYYY-MM-DD.json`):**
- Contains all the raw data, calculations, and simulation results for programmatic use.
**Markdown Report (`risk_report_YYYY-MM-DD.md`):**
- **Risk Summary**:
- **Portfolio Beta**: e.g., 1.15 vs. SPY
- **99% VaR (1-day)**: e.g., "$5,200 (Your portfolio has a 1% chance of losing at least $5,200 on any given day)."
- **Historical Max Drawdown**: e.g., "-28.5%"
- **Concentration Analysis**:
- Top 5 Positions by Weight
- Sector Allocation Chart
- **Stress Test Results**:
- A table showing simulated P&L for 2008, 2020, and 2022 scenarios.
- **Correlation Hotspots**:
- Lists the most highly correlated pairs of assets in the portfolio.
- **Actionable Insights**:
- e.g., "Your portfolio is heavily concentrated in Technology (65%). Consider adding exposure to other sectors like Healthcare or Consumer Staples to improve diversification."
- e.g., "The high correlation between AAPL and MSFT reduces diversification benefits. Consider trimming one or adding an uncorrelated asset."
### Step 4: Present Findings to User
Synthesize the key findings from the Markdown report into a clear, actionable summary. Start with the most critical information (like high concentration or poor stress test results) and provide concrete suggestions for risk mitigation.