スキル一覧に戻る
Rachnog

risk-assessment

by Rachnog

2🍴 0📅 2026年1月15日
GitHubで見るManusで実行

SKILL.md


name: risk-assessment description: Assess portfolio risk using volatility, drawdown, and other risk metrics. Use when evaluating the risk characteristics of a portfolio or comparing risk profiles.

Risk Assessment Skill

Key Risk Metrics

MetricDescriptionCalculationGood Value
VolatilityAnnualized standard deviationσ × √252< 15% conservative, < 25% aggressive
Max DrawdownWorst peak-to-trough declinemin(cumulative returns)> -20% conservative
Sharpe RatioRisk-adjusted return(R - Rf) / σ> 1.0 good, > 2.0 excellent
Sortino RatioDownside risk-adjusted return(R - Rf) / σ_down> 1.5 good
Value at Risk (VaR)Maximum expected loss at confidencePercentile of returns95% VaR < 2% daily

Risk Assessment Process

Step 1: Analyze Volatility

import numpy as np

returns = prices.pct_change().dropna()
volatility = returns.std() * np.sqrt(252)  # Annualized
print(f"Annualized Volatility: {volatility:.2%}")

Step 2: Calculate Maximum Drawdown

def calculate_max_drawdown(returns):
    cumulative = (1 + returns).cumprod()
    rolling_max = cumulative.expanding().max()
    drawdown = (cumulative - rolling_max) / rolling_max
    return drawdown.min()

max_dd = calculate_max_drawdown(portfolio_returns)
print(f"Maximum Drawdown: {max_dd:.2%}")

Step 3: Compute Sharpe Ratio

risk_free_rate = 0.02  # 2% annual
excess_return = portfolio_return - risk_free_rate
sharpe = excess_return / volatility
print(f"Sharpe Ratio: {sharpe:.3f}")

Risk Tolerance Mapping

Risk ToleranceTarget VolatilityMax Drawdown ToleranceSuitable Universe
Low< 10%> -15%conservative
Medium10-18%> -25%global_diversified
High18-30%> -40%us_tech, aggressive

Risk Flags

Warn the investor if:

  • Volatility exceeds their stated tolerance by > 20%
  • Max drawdown exceeds tolerance threshold
  • Sharpe ratio < 0.5 (poor risk-adjusted returns)
  • Single position exceeds max_position constraint

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です