技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
fund-risk-compare【数据与研究】Compare multiple ETFs using NAV CSV data, generating key risk-return metrics like annualized return, max drawdown, Sharpe ratio, and a correlation matrix. Triggered when users ask to compare ETFs or funds, calculate performance metrics, analyze NAV data, or mention terms like Sharpe ratio, correlation analysis, or max drawdown.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Performs multi-dimensional risk-return analysis on multiple ETFs based on user-provided NAV (Net Asset Value) data. Automatically calculates annualized returns, max drawdown, Sharpe ratio, and generates a correlation matrix.
python scripts/etf_screener.py --input nav_data.csv
python scripts/etf_screener.py --input nav_data.csv --risk-free 0.03 --output report.csv
python scripts/etf_screener.py --input nav_data.csv --json
CSV file with dates in the first column and NAV values for each ETF in subsequent columns:
date,SP500_ETF,NASDAQ_ETF,BOND_ETF
2023-01-03,1.0000,1.0000,1.0000
2023-01-04,1.0050,0.9980,1.0020
2023-01-05,1.0120,1.0010,1.0080
...
NaN — they are automatically skippedComputed from the first and last NAV values, then annualized by the number of trading days:
Ann. Return = (NAV_end / NAV_start) ^ (trading_days / n_days) - 1
The largest peak-to-trough decline in the NAV series:
MDD = max( (peak - trough) / peak )
A risk-adjusted return metric:
Sharpe = (Annualized Return - Risk-Free Rate) / Annualized Volatility
Annualized volatility is derived from the standard deviation of daily returns multiplied by √(trading_days).
Pearson correlation coefficients computed from daily returns, measuring the co-movement between ETFs. A coefficient near 1 indicates strong positive correlation, near 0 indicates no correlation, and near -1 indicates negative correlation.
| Parameter | Required | Default | Description |
|---|---|---|---|
--input / -i | Yes | - | Path to the NAV CSV file |
--risk-free / -rf | No | 0.02 | Annual risk-free rate (e.g., 0.03 for 3%) |
--trading-days | No | 252 | Trading days per year (typically 252 for US/China markets) |
--output / -o | No | - | Output file path (.csv or .json) |
--json | No | false | Output results as JSON to stdout |
--risk-free parameter to match current market conditions