Performance metrics (fynance.metrics)

Risk-adjusted ratios, return and drawdown metrics to evaluate a strategy out-of-sample. A metric evaluates a series — distinct from fynance.features, which builds inputs.

Ratios & returns

sharpe(X[, rf, period, log, axis, dtype, ddof])

Compute the Sharpe ratio for each X' series.

sortino(X[, rf, period, log, axis, dtype, ddof])

Compute the Sortino ratio for each X' series.

calmar(X[, period, axis, dtype, ddof])

Compute the Calmar Ratio for each X' series.

annual_return(X[, period, axis, dtype, ddof])

Compute compouned annual returns of each X' series.

annual_volatility(X[, period, log, axis, ...])

Compute the annualized volatility of each X' series.

diversified_ratio(X[, W, std_method, axis])

Compute diversification ratio of a portfolio.

perf_index(X[, base, axis, dtype])

Compute performance of prices or index values along time axis.

perf_returns(R[, kind, base, axis, dtype])

Compute performance of returns along time axis.

perf_strat(X[, S, base, axis, dtype, reinvest])

Compute the performance of strategies for each X' series.

returns_strat(X[, S, kind, base, axis, dtype])

Compute the returns of strategies for each X' series.

Drawdown

drawdown(X[, raw, axis, dtype])

Measures the drawdown of each X' series.

mdd(X[, raw, axis, dtype])

Compute the maximum drawdown for each X' series.

Rolling versions

roll_sharpe(X[, rf, period, w, log, axis, ...])

Compute rolling sharpe ratio of each X' series.

roll_calmar(X[, period, w, axis, dtype, ddof])

Compute the rolling Calmar ratio of each X' series.

roll_annual_return(X[, period, w, axis, ...])

Compute rolling compouned annual returns of each X' series.

roll_annual_volatility(X[, period, log, w, ...])

Compute the annualized volatility of each X' series.

roll_drawdown(X[, w, raw, axis, dtype])

Measures the rolling drawdown of each X' series.

roll_mdd(X[, w, raw, axis, dtype])

Compute the rolling maximum drawdown for each X' series.

Aggregated report

summary(prices[, period, rf])

Standard performance summary of an equity/price curve.