yf-risk

Analyze yfinance portfolio returns to generate risk metrics and allocation recommendations.

1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/phanijapps/zbot --skill yf-risk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yf-risk
Source: https://github.com/phanijapps/zbot/tree/main/gateway/templates/skills/yf-risk
Command: npx skills add https://github.com/phanijapps/zbot --skill yf-risk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Perform portfolio construction and risk diagnostics directly from yfinance multi-asset return series. Use when an agent needs correlation analysis, drawdown and VaR metrics, stress scenarios, or weight optimization for stock, ETF, and crypto portfolios.

Core Features & Use Cases

  • Compute aligned return matrices from yfinance data.
  • Generate risk metrics including annualized return, volatility, Sharpe ratio, max drawdown, rolling correlations, VaR/CVaR.
  • Run scenario checks (market shocks, volatility spikes) and optionally optimize weights under explicit constraints.
  • Use case: An AI agent evaluating a mixed-asset portfolio can quickly obtain risk diagnostics and a suggested allocation.

Quick Start

Compute risk metrics and a risk-aware allocation from the aligned yfinance return streams.

Frequently Asked Questions about yf-risk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute portfolio risk metrics like VaR and max drawdown from yfinance data?

Compute portfolio risk metrics from yfinance data by generating an aligned return matrix to deliver annualized return, volatility, Sharpe ratio, max drawdown, VaR, and CVaR diagnostics for stock, ETF, and crypto portfolios.

Can I optimize portfolio weights with explicit constraints using yfinance return series?

You can optimize portfolio weights with explicit constraints using yfinance return series to generate an optional optimized allocation that aligns with your risk diagnostics and scenario limits.

What is the best way to run stress tests on a mixed-asset portfolio?

The best way to run stress tests on a mixed-asset portfolio is by applying market shock and volatility spike scenarios to yfinance return streams, producing stress-test summaries for stocks, ETFs, and crypto assets.

Does this portfolio risk analytics approach support correlation analysis for crypto and ETFs?

Yes, portfolio risk analytics supports correlation analysis for crypto and ETFs by computing an aligned return matrix from yfinance data, enabling rolling correlation checks across mixed-asset portfolios.

How do I generate a risk metrics table for stock and ETF portfolios?

Generate a risk metrics table for stock and ETF portfolios by processing aligned yfinance return streams to calculate annualized volatility, Sharpe ratio, drawdown, and VaR/CVaR values.

When should I use yfinance return series for portfolio construction instead of other data sources?

Use yfinance return series for portfolio construction when you need direct risk diagnostics, correlation analysis, and weight optimization for stock, ETF, and crypto portfolios without external data dependencies.