Token导航 LogoToken导航TokenDH.com
待分类只读github未标认证来源可访问许可证需确认审计通过

performance-metrics绩效指标

Agent Skill

performance-metrics 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,002

周安装

81

GitHub Stars

58

下载量

629
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:performance-metrics(绩效指标)
来源仓库:https://github.com/joellewis/finance_skills
仓库路径:skills/performance-metrics
安装命令:
npx skills add https://github.com/joellewis/finance_skills --skill performance-metrics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/joellewis/finance_skills --skill performance-metrics

简介

performance-metrics 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或代码变更进行整理。
  • 通过 npx skills add 命令从指定仓库安装并使用。
  • 建议确认权限范围和维护状态,注意是否触发联网或文件读写。
  • 可结合来源仓库和 README 进一步核验具体用法。

SKILL.md

Performance Metrics

Purpose

Evaluate investment performance on a risk-adjusted basis using industry-standard ratios and capture analysis. This skill covers the Sharpe, Sortino, Information, Treynor, and Calmar ratios, the Omega ratio, upside/downside capture ratios, and M-squared. These metrics allow fair comparison across strategies with different risk profiles.

Layer

1a — Realized Risk & Performance

Direction

Retrospective

When to Use

  • Evaluating how well an investment or strategy performed relative to the risk it took
  • Comparing managers, funds, or strategies on a risk-adjusted basis
  • Computing Sharpe, Sortino, Information Ratio, Treynor, or Calmar ratios
  • Performing upside/downside capture analysis against a benchmark
  • Calculating the Omega ratio for a given threshold return
  • Assessing M-squared (Modigliani-Modigliani) risk-adjusted performance

Core Concepts

Sharpe Ratio

The most widely used risk-adjusted performance measure. It divides excess return (over the risk-free rate) by total volatility.

SR = (R_p - R_f) / sigma_p
  • R_p: annualized portfolio return
  • R_f: annualized risk-free rate
  • sigma_p: annualized portfolio volatility (standard deviation of returns)

A higher Sharpe ratio indicates more return per unit of total risk. Typical benchmarks: SR < 0.5 is poor, 0.5-1.0 is acceptable, > 1.0 is strong, > 2.0 is exceptional.

Annualization: If computed from monthly data, SR_annual = SR_monthly * sqrt(12).

Sortino Ratio

Replaces total volatility with downside deviation, penalizing only harmful volatility (returns below a Minimum Acceptable Return).

Sortino = (R_p - R_f) / sigma_downside

where sigma_downside = sqrt((1/n) * sum(min(R_i - MAR, 0)^2)).

Common MAR choices: 0%, risk-free rate, or a target return. Always state which MAR is used.

Information Ratio

Measures active return (alpha) per unit of active risk (tracking error) relative to a benchmark.

IR = (R_p - R_b) / TE

where TE = std(R_p - R_b) * sqrt(N).

An IR above 0.5 is generally considered good; above 1.0 is exceptional and difficult to sustain.

Treynor Ratio

Measures excess return per unit of systematic risk (beta) rather than total risk.

Treynor = (R_p - R_f) / beta_p

Useful for evaluating diversified portfolios where idiosyncratic risk has been diversified away. For undiversified holdings, the Sharpe ratio is more appropriate.

Calmar Ratio

Relates annualized return to the worst peak-to-trough drawdown.

Calmar = CAGR / |MaxDrawdown|

A Calmar ratio above 1.0 means the annualized return exceeds the maximum drawdown. This ratio is popular among CTAs and hedge fund investors. Typically computed over a 3-year window.

Omega Ratio

A gain-loss ratio that considers the entire return distribution above and below a threshold tau.

Omega(tau) = integral from tau to +inf of [1 - F(r)] dr
             / integral from -inf to tau of F(r) dr

where F(r) is the cumulative distribution function of returns.

In practice, this is computed as:

Omega(tau) = sum(max(R_i - tau, 0)) / sum(max(tau - R_i, 0))

Omega > 1 means expected gains above tau exceed expected losses below tau. Unlike Sharpe, Omega captures the full shape of the distribution (skewness, kurtosis).

Upside and Downside Capture Ratios

Measure how the portfolio participates in benchmark up and down markets.

Up Capture   = R_p(in up months) / R_b(in up months) * 100
Down Capture = R_p(in down months) / R_b(in down months) * 100
Capture Ratio = Up Capture / Down Capture

Ideal profile: Up Capture > 100% and Down Capture < 100%, yielding a Capture Ratio > 1. "Up months" and "down months" are defined by the benchmark return being positive or negative, respectively.

M-Squared (Modigliani-Modigliani)

Expresses risk-adjusted return in the same units as return, by leveraging or deleveraging the portfolio to match benchmark volatility.

M^2 = R_f + SR_p * sigma_b
    = R_f + ((R_p - R_f) / sigma_p) * sigma_b

Interpretation: "If this portfolio were scaled to have the same volatility as the benchmark, it would have returned M-squared." This makes it directly comparable to benchmark returns.

Key Formulas

FormulaExpressionUse Case
Sharpe Ratio(R_p - R_f) / sigma_pReturn per unit of total risk
Sortino Ratio(R_p - R_f) / sigma_downsideReturn per unit of downside risk
Information Ratio(R_p - R_b) / TEActive return per unit of active risk
Treynor Ratio(R_p - R_f) / beta_pReturn per unit of systematic risk
Calmar RatioCAGR /MaxDD
Omega Ratiosum(max(R_i - tau, 0)) / sum(max(tau - R_i, 0))Full-distribution gain-loss ratio
Up CaptureR_p(up) / R_b(up) * 100Participation in rising markets
Down CaptureR_p(down) / R_b(down) * 100Participation in falling markets
M-SquaredR_f + SR_p * sigma_bRisk-adjusted return in return units

Worked Examples

Example 1: Sharpe Ratio Calculation

Given: A fund returned 12% annualized, the risk-free rate is 4%, and the fund's annualized volatility is 15%.

Calculate: Sharpe Ratio.

Solution:

SR = (0.12 - 0.04) / 0.15
   = 0.08 / 0.15
   = 0.533

The fund earned 0.533 units of excess return per unit of risk. This is in the "acceptable" range but below 1.0.

Example 2: Comparing Funds with Sharpe and Sortino

Given:

  • Fund A: Sharpe = 0.8, Sortino = 1.2
  • Fund B: Sharpe = 0.7, Sortino = 1.5

Calculate: Which fund is better for a downside-averse investor?

Solution:

Fund A has a higher Sharpe ratio (0.8 vs 0.7), indicating better total-risk-adjusted performance. However, Fund B has a notably higher Sortino ratio (1.5 vs 1.2), meaning it delivers significantly more return per unit of downside risk.

The divergence implies Fund B's volatility is more skewed to the upside -- its total volatility includes more "good" volatility (gains), while its downside volatility is relatively contained.

For a downside-averse investor, Fund B is preferable because the Sortino ratio better captures the risk they care about (losses), and Fund B's superior Sortino indicates better downside risk management.

Example 3: Information Ratio

Given: A portfolio returned 10% annualized, its benchmark returned 8%, and the tracking error is 4%.

Calculate: Information Ratio.

Solution:

IR = (0.10 - 0.08) / 0.04
   = 0.02 / 0.04
   = 0.50

The manager generated 0.50 units of active return per unit of active risk. This is generally considered a good IR, suggesting consistent alpha generation relative to benchmark deviations.

Common Pitfalls

  • Annualizing Sharpe incorrectly: The Sharpe ratio scales by sqrt(N) where N is the number of periods per year. SR_annual = SR_monthly * sqrt(12), not * 12. The excess return and volatility must be in consistent units before dividing.
  • Using wrong risk-free rate frequency: If computing monthly Sharpe, use the monthly risk-free rate (annual rate / 12), not the annual rate directly.
  • Sortino MAR ambiguity: The Sortino ratio result changes significantly depending on whether MAR = 0, MAR = risk-free rate, or MAR = some target return. Always state the MAR assumption explicitly.
  • Small sample sizes making ratios unreliable: Ratios computed from fewer than 36 monthly observations are statistically unreliable. A Sharpe ratio from 12 months of data has a standard error of approximately sqrt((1 + SR^2/2) / 12), which is very wide.
  • Comparing Sharpe ratios across different time periods: A Sharpe of 1.0 in a low-vol environment is not the same as 1.0 in a high-vol environment. Performance ratios are period-specific and not directly comparable across different market regimes.

Cross-References

  • historical-risk (wealth-management plugin, Layer 1a): Provides the risk measures (volatility, drawdown, downside deviation, tracking error) used as denominators in these performance ratios.
  • forward-risk (wealth-management plugin, Layer 1b): Forward-looking risk measures (VaR, CVaR) complement retrospective performance assessment by estimating future potential losses.
  • volatility-modeling (wealth-management plugin, Layer 1b): Volatility forecasts from GARCH or EWMA can be used to compute forward-looking or conditional Sharpe ratios.

Reference Implementation

See scripts/performance_metrics.py for computational helpers.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.86%
按下载量换算238

Claude

32.65%
按下载量换算205

Cursor

17.56%
按下载量换算110

Gemini CLI

9.88%
按下载量换算62

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills