Interactive demo
I built this demo on synthetic data. Set the weight between two assets and pick a window: a dependency-free TypeScript engine recomputes the summary tables, the drawdown, and the rolling Sharpe ratio in your browser. Where the history does not cover the window, the page says Unavailable instead of quietly using a shorter one.
Portfolio over the last 5 years: 1,256 daily returns after 2020-12-31 through 2025-12-31.
Synthetic data from a seeded generator. No real security, index, fund, or market price is used.
A seeded script generates ten years of daily returns, from the start of 2016 to the end of 2025, on a synthetic trading calendar: a benchmark that switches between calm and stressed regimes; Asset A, an equity-like series that moves with the benchmark; and Asset B, a defensive series whose history starts in July 2018. The portfolio is rebalanced to the slider's weights every day. No real security, index, fund, or market price is used.
The engine is nineteen pure functions with no dependencies: annualized return and volatility, the Sharpe and Sortino ratios, downside deviation, maximum drawdown, the drawdown path and episode table, the Calmar ratio, alpha and beta, tracking error, the information ratio, historical VaR and CVaR, up and down capture, hit rate, rolling Sharpe, and a summary table. Volatility is the sample standard deviation annualized by the square root of 252; VaR is the 5th percentile of daily returns; alpha is Jensen's alpha from a CAPM beta. A metric below its minimum sample (20 observations for volatility, tail, and regression measures; 5 for compounding measures) or with a zero denominator is unavailable, never zero.
The window toggle applies the same rule to history. A metric is computed over a window only when every asset with weight in the portfolio has data for the whole window. A five year figure computed on three years of data would be a different claim under the wrong label, so the 10 year window stays unavailable while Asset B has any weight, and it computes at 100% Asset A.
The engine's tests check cases with known answers (constant returns, a fixed drawdown path, and a benchmark identical to the asset, which must give a beta of 1 and an alpha of 0) and compare every function with reference values that a Python implementation of the same formulas produced on the same synthetic input, agreeing to within one part in a billion.
View the raw data that drives this page.
Every figure here names its window and its minimum sample, and a window the data cannot support says so. If your team needs portfolio and risk analytics built that way, tell me about the role.