Weights, risk and what could go wrong
A weight vector you can defend, and a shock you can survive.
Mean-variance optimisation solves the efficient frontier by SLSQP and shows it against a Monte Carlo comparison cloud. Six other construction methods sit alongside it — equal weight, minimum variance, risk parity, hierarchical risk parity, Kelly sizing, CVaR optimisation, Black-Litterman. Every allocation carries the same risk diagnostics and the same set of historical and hypothetical shocks, because a portfolio that looks efficient on one covariance estimate still has to survive a bad quarter.
- Construction methods
- 7equal weight, minimum variance, maximum Sharpe, risk parity, HRP, Kelly, CVaR optimisation
- Covariance estimators
- 4sample, Ledoit-Wolf, denoised (RMT), EWMA
- VaR methods
- 4historical, parametric, Cornish-Fisher, Monte Carlo — plus extreme value theory for the tail
- Historical stress episodes
- 6each replayed on your own loaded price history for its exact dates
01What you actually do here
Five things, in the order the page presents them.
Read the risk diagnostics before you weight anything
Annualised return and volatility, Sharpe, Sortino, Calmar, VaR 95, CVaR 95, maximum drawdown, beta, alpha, tracking error, information ratio, and up/down capture — for every security in the universe, before an optimiser touches a weight.
Choose a covariance estimator deliberately
Sample covariance, Ledoit-Wolf shrinkage, a denoised random-matrix-theory estimate, or EWMA at a 0.94 decay. A poorly conditioned matrix is repaired rather than fed to the optimiser as-is, because an ill-conditioned covariance matrix produces weights that are precise and wrong.
Solve the frontier, long-only or long/short
Mean-variance optimisation by SLSQP returns the max-Sharpe and minimum-variance points on the frontier. A long/short Monte Carlo comparison cloud normalises on gross exposure, not net, because a net-normalised cloud would be unbounded.
See a refusal when the constraints cannot be met
An infeasible combination of weight bounds is refused outright, with the specific reason recorded, rather than silently dropped or approximated to the nearest feasible point.
Stress the allocation, historically and hypothetically
Replay one of six named historical episodes on your own loaded price history for its exact dates, propagate a hypothetical shock through each asset’s beta, or run a reverse stress test starting from an unacceptable loss. A replay refuses rather than approximates if your data does not cover the episode’s dates.
02How it works
The method, stated for the specialist.
Portfolio construction and stress testing sit on the same evidence-first standard as the rest of the workspace: a number that cannot be computed honestly is refused, not approximated.
- The research-layer construction methods
- Equal weight is the baseline the other six frequently fail to beat. Minimum variance and maximum Sharpe come off the same mean-variance frontier. Risk parity weights so each asset contributes equally to portfolio risk; hierarchical risk parity allocates down a clustering tree, avoiding covariance inversion entirely. Kelly sizing is growth-optimal position sizing. CVaR optimisation minimises expected shortfall rather than variance. Black-Litterman blends equilibrium returns with explicit views and stated confidence.
- Infeasible points are recorded, not dropped
- A frontier point the optimiser could not reach under its constraints is kept with the specific reason it failed, so an infeasible region is visible rather than simply missing from the chart.
- Four VaR methods, plus a tail-specific fifth
- Historical, parametric, Cornish-Fisher and Monte Carlo VaR are reported alongside Conditional VaR, which is coherent where VaR is not. Extreme value theory fits the tail via a generalised Pareto distribution rather than assuming the same distribution holds throughout.
- Historical scenarios replay real prices, on real dates
- The GFC (2008-09-01 to 2009-03-31), the May 2010 Flash Crash, the 2011 euro sovereign-debt selloff, the 2015 China devaluation, the February 2018 volatility spike, and the 2020 Covid crash are each replayed on the securities you actually loaded, for their exact dates — not simulated. The Flash Crash carries an explicit caveat: daily bars cannot see an intraday liquidity event, only its close-to-close aftermath.
- Hypothetical shock and reverse stress are not forecasts
- A hypothetical shock propagates a specified market move through each asset’s beta and rescales the covariance matrix. A reverse stress test starts from an unacceptable loss and works backward to what would cause it. Neither predicts what will happen — both describe what would happen under a stated assumption.
- Explainability applies here too
- Where a model informs the allocation, permutation importance and partial dependence are computed out of sample on the same pipeline used elsewhere in the workspace — no separate, unaudited explanation path for portfolio decisions.
03What you get out
Outputs, and what they let you defend.
Portfolio and risk results feed directly into the same evidence pack the rest of the workspace produces.
- Absolute and benchmark-relative risk sections of the evidence pack, per security and for the portfolio as a whole
- The Portfolio Construction section: chosen method, covariance estimator, resulting weights
- Frontier points, including infeasible ones, with the reason recorded
- Historical and hypothetical scenario results, with any coverage gap stated rather than papered over
- VaR and CVaR at the confidence level set in Settings, applied consistently across the report
04What this does not do
Stated plainly, because it matters as much as what it does.
Research and analysis, not order execution
This is a research workspace. `GET /api/health` reports live order routing as disabled, and nothing here places, routes or sizes a live order.
Stress scenarios are not forecasts
A historical replay tells you what your current holdings would have done in a past episode. A hypothetical shock tells you what a stated move would do under today’s beta and covariance. Neither predicts what markets will do next.
Losses are reported as positive numbers
VaR, CVaR and drawdown figures are shown as positive magnitudes throughout, by convention — a larger number is a larger loss, not a larger gain.
The bundled reference data is synthetic
The Quant Compose Reference Data provider is deterministic and seeded with no network call, useful for exploring the workspace, and never a basis for a claim about a real security.
Keep going
Related capabilities
Weight a portfolio and see where it breaks.
Beta researchers solve a frontier, then run six historical episodes against the same allocation.