mcpField
R
risk-assessment

risk-assessment

github.com/staskhData & databases398102 installsUpdated today
Repository

About risk-assessment

A command-line skill for calculating historical risk metrics for stocks and positions. It returns JSON and explains the metrics, with position-specific dollar VaR when a position size is provided.

Key features

  1. 01Historical volatility and beta vs SPY
  2. 0295% and 99% daily VaR
  3. 03Maximum drawdown and Sharpe ratio
  4. 04Dollar VaR for a specified position
  5. 05JSON output with New York timestamps

Use cases

  1. 01Reviewing the historical risk of a stock
  2. 02Estimating potential losses for a position

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/staskh/trading_skills --skill risk-assessment

After installing, type/risk-assessmentin Claude Code to confirm it loaded.

Bundled filesscripts/risk.py

Details

From the project README

Risk Assessment

Calculate risk metrics for stocks and positions.

Instructions

Note: If uv is not installed or pyproject.toml is not found, replace uv run python with python in all commands below.

uv run python scripts/risk.py SYMBOL [--period PERIOD] [--position-size SIZE]

Arguments

  • SYMBOL - Ticker symbol
  • --period - Analysis period: 1mo, 3mo, 6mo, 1y (default: 1y)
  • --position-size - Dollar amount for position-specific metrics (optional)

Output

Returns JSON with:

  • volatility - Historical volatility (annualized)
  • beta - Beta vs SPY
  • var_95 - 95% Value at Risk (daily)
  • var_99 - 99% Value at Risk (daily)
  • max_drawdown - Maximum drawdown in period
  • sharpe_ratio - Risk-adjusted return
  • position_risk - If position-size provided, dollar VaR

Explain what the risk metrics mean and suggest position sizing if relevant.

Dependencies

  • numpy
  • yfinance

Timezone

All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.

Comments

Markdown supported