Performance
Returns, risk-adjusted ratios, drawdowns, benchmarks and sector performance.
Turn prices or equity into returns and measure them: time- and money-weighted returns, Sharpe, Sortino, Calmar and Omega ratios, drawdowns, benchmark-relative statistics and contribution by group. analyze produces a full summary in one call.
Try it live
Common APIs
fn
analyzeThe performance summary facade (dx §2.3): plain call → the summary; `.explain()` → the core Computed envelope around it (the summary's own warnings ride `diagnostics.warnings`, its echoed conventions ride `assumptions`).fnsimpleReturnsSimple period-over-period returns; output length is `prices.length - 1`.fnequityCurveEquity curve (growth of `start`) from a series of simple returns.fnsharpeAnnualized Sharpe ratio of a per-period return series.fnsortinoAnnualized Sortino ratio (downside-deviation-adjusted).fnmaxDrawdownMaximum drawdown facade (dx §2.3): plain call → the `DrawdownResult`; `.explain()` → the `Computed` envelope.fnunderwaterPer-period drawdown series (input-aligned): the fractional decline from the running peak at each index, as a non-negative number (0 at a fresh high).fntimeWeightedReturnTime-weighted return: simple returns between consecutive valuation dates, linked geometrically.fnmoneyWeightedReturnMoney-weighted return: the dated internal rate of return of the INVESTOR's cash-flow schedule, composed from `datedInternalRateOfReturn` in `@insiderfinance/totalfinance/valuation` (annual compounding, ACT/365F — echo…fninformationRatioInformation ratio: annualized mean active return divided by annualized tracking error — the Sharpe ratio of the active (strategy − benchmark) return series.fnrollingSharpeRolling annualized Sharpe ratio over a trailing window (leading `window − 1` entries are `NaN`).fnsectorPerformanceEqual-weight sectors from same-period decimal returns.Guides
Complete API reference
Browse all public exports, types, and feature imports below.