Skip to risk calculator
DondeRinde Quant Lab
Home / Quant Lab / Financial Risk Calculator

QUANT LAB · HISTORICAL RISK ANALYTICS · LOCAL PRIVACY

Financial Risk Calculator

Load your own price or return CSV locally to compute cumulative return, volatility, Sharpe, Sortino, per-period historical VaR & CVaR, maximum drawdown, equity curve, and descriptive statistics. Strict validation with zero silent imputation.

Loading synthetic example...

Historical VaR & CVaR (single period)

Methodological distinction: these metrics measure empirical loss over a single period of your uploaded series (daily, weekly, or monthly). They differ from cumulative terminal-horizon VaR/CVaR in the Monte Carlo Simulator.

Equity curve (base 100) & drawdown

Move your pointer across the chart to inspect compounded equity, period return, and peak-to-trough drawdown.

Per-period return distribution

Descriptive statistics

Statistic Observed value

TECHNICAL & EDUCATIONAL DOCUMENTATION

Formulas, validation, limitations & interpretation

Formulas aligned with Quant Lab

r_t = P_t / P_{t−1} − 1   (price mode; requires P_t > 0 and r_t > −1)
r_{f,per} = expm1(log1p(r_{f,annual}) / A)
R_cum = expm1(Σ ln(1 + r_t)),   CAGR = expm1((A/N) · Σ ln(1 + r_t))
σ_annual = s_{ddof=1}(r) · √A,   σ_down = √( (1/N) Σ min(r_t − r_{f,per}, 0)² )
Sharpe = mean(r − r_{f,per}) · √A / s,   Sortino = mean(r − r_{f,per}) · √A / σ_down
VaR_α^per = −Q_{1−α}(r),   CVaR_α^per = −exact fractional lower-(1−α) tail mean

Whenever s ≤ 10⁻¹⁵, σ_down ≤ 10⁻¹⁵, or MaxDD ≤ 10⁻¹⁵, the ratio is reported explicitly as Undefined (null in JSON), never as 0 or Infinity.

Strict CSV validation policy

  • Zero silent imputation: blank interior rows, NA/NaN cells, column mismatches, unclosed quotes, and non-numeric strings are rejected explicitly.
  • Temporal integrity: every date must be a valid ISO calendar date (YYYY-MM-DD), strictly ascending, with zero duplicates.
  • Local bounds: capped at 5 MiB and 50,000 rows to keep browser memory safe.
  • Privacy: files stay strictly in local memory and are never transmitted over the network.

Educational interpretation

  • VaR vs. CVaR: 95% VaR marks the threshold of the worst 5% of periods, whereas CVaR (Expected Shortfall) averages how severe losses were beyond that cutoff.
  • Sharpe vs. Sortino: Sharpe penalizes upside and downside variance equally; Sortino focuses solely on deviations below the per-period reference rate r_{f,per}.
  • Drawdown: measures the worst peak-to-trough decline endured during the sample, exposing path risk hidden by volatility alone.

Explicit limitations

  • Descriptive past data: historical statistics do not forecast future performance or tail risk.
  • √A annualization: assumes i.i.d. returns; autocorrelation or volatility clustering can bias annualized volatility and Sharpe ratios.
  • Sample sensitivity: with fewer than 30 observations, 99% VaR/CVaR estimates depend heavily on one or two extreme bars.
  • Net vs. gross: unless your CSV already reflects commissions, taxes, and slippage, outputs are gross of execution costs.

References

  • Sharpe, W. F. (1994). The Sharpe Ratio. The Journal of Portfolio Management, 21(1), 49–58.
  • Sortino, F. A., & Price, L. N. (1994). Performance measurement in a downside risk framework. The Journal of Investing, 3(3), 59–64.
  • Rockafellar, R. T., & Uryasev, S. (2000). Optimization of Conditional Value-at-Risk. Journal of Risk, 2(3), 21–41.
  • Acerbi, C., & Tasche, D. (2002). On the coherence of Expected Shortfall. Journal of Banking & Finance, 26(7), 1487–1503.