How MAISNER Works
A technical reference for the mathematical models underlying the platform. Written for quantitative professionals, portfolio managers, and technically minded investors.
Portfolio Optimization — Mean-Variance
MAISNER implements Markowitz Mean-Variance Optimization (MVO) with several institutional-grade enhancements. The core problem maximizes the Sharpe ratio subject to linear constraints.
Objective Function
Constraints
Three portfolios are computed simultaneously: Max Sharpe, Minimum Variance, and Equal Weight. This allows direct comparison of optimization strategies against a naive benchmark.
| Parameter | Value | Description |
|---|---|---|
| RISK_FREE | 3.80% | Risk-free rate (ECB rate proxy) |
| WEIGHT_MAX | 35% | Maximum weight per asset |
| FREQ | 252 / 12 | Daily if ≥400 obs, else monthly |
Constrained Optimization
The Constrained Optimizer allows portfolio managers to impose explicit structural requirements on individual positions and sectors, then optimizes the remaining free budget using the same RMT-MVO engine. This is the institutional standard for managing client mandates, regulatory constraints, and conviction-driven overrides.
Asset Partition
All assets in the portfolio are classified into one of three sets before optimization begins.
𝓑 = bounded set (per-ticker bounds: lbi ≤ wi ≤ ubi)
𝓕 = free set (standard bounds: 0 ≤ wi ≤ wmax)
Remaining Budget
Full Optimization Problem
Constraint Types
| Type | Syntax | Description |
|---|---|---|
| Locked weight | wi = c | Position fixed at exact percentage. Optimizer cannot move it. |
| Locked shares | ni = k | Fixed number of shares. Weight derived from current market price. |
| Min/max per ticker | lbi ≤ wi ≤ ubi | Optimizer chooses within the specified range. |
| Sector floor | Σsector ≥ smin | Forces minimum allocation to a sector. |
| Sector ceiling | Σsector ≤ smax | Caps total allocation to a sector (default 40%). |
Feasibility — checked before and after optimising
Before optimising, the complete linear system (Σw = 1, per-asset bounds, user sector floors/ceilings, or the default 40% sector caps and 50% combined ETF cap when no sector constraint is given and n ≥ 8) is solved as a feasibility linear programme (HiGHS). If no portfolio satisfies it, the job stops with the reason shown to the user: e.g. “the per-asset maximums allow at most 60% to be invested”, “sector minimums add up to 110%”, or a sector floor on a sector the portfolio does not hold. After optimising, every returned weight vector is checked against the same system (tolerance 10−4); a violation is an error, never a silently returned portfolio. (Before November 2026 an infeasible set returned the optimiser’s start vector — e.g. 50/50 over a 35% cap.)
Small books. Free assets use the cap max(WEIGHT_MAX, min(0.50, max(1.5/n, 1/(n−1)))) when n < 8 — the same adaptive bound as the main optimizer — so a 2-asset book can still be fully invested.
Sector names. Sector constraints are matched to the canonical sector groups (Technology, Financials, Energy, Healthcare, Consumer Staples, …); legacy labels (Finance, Oil/Gas, Consumer, Banks, …) are accepted as aliases. An unknown name is rejected — it used to be dropped silently, which also switched off the default caps. Sectors come from FMP when available, otherwise from the last FMP answer stored on disk, otherwise from the Stocks.xlsx sector column, so the same tickers always get the same sectors.
Units. The UI sends fractions (5% → 0.05). API callers may send fractions or percents; a value greater than 1 is read as a percent.
Risk-Free Rate and the Cost of Constraints
The Sharpe objective, the reported Sharpe ratios and the constraint-cost analysis all use the user’s risk-free rate. The cost of constraints compares the constrained optimum with the true unconstrained long-only maximum-Sharpe portfolio (only w ≥ 0, Σw = 1; no caps, no tilts), obtained by homogenisation y = κw:
Multi-Asset · CVaR Engine
The CVaR engine replaces variance by Conditional Value-at-Risk at the user’s confidence level α (default 95%), estimated on S historical monthly scenarios rs (months where every asset has a price; simple returns, re-centred so each asset’s scenario mean equals its expected return / 12 — history supplies the tail shape and co-movement, the engine supplies the expected return). At least 36 common months are required. Every problem is a linear programme (Rockafellar & Uryasev, 2000) over the same linear constraint system as the MVO engine:
| Mode | Problem |
|---|---|
| Conservative | min CVaRα(w) |
| Standard | max STARR = (μ − rf)Tw / CVaRα(w) — homogenised LP: max (μ−rf)Ty s.t. CVaRα(y) ≤ 1, constraints scaled by κ |
| Balanced | the STARR portfolio, blended toward min-CVaR until σ ≤ vol cap |
| Aggressive | max μTw (identical in both engines) |
| Dividend | max yieldTw − 0.3·√12·CVaRα(w) |
The result reports the 1-month CVaRα of the optimal, minimum-risk and equal-weight portfolios (and the current holdings in the analyzer). Until November 2026 the “Multi-Asset (CVaR)” button ran the MVO engine unchanged.
Random Matrix Theory — Covariance Cleaning
Raw sample covariance matrices are notoriously noisy for typical portfolio sizes. MAISNER applies Marchenko-Pastur filtering to separate signal eigenvalues from noise eigenvalues.
Marchenko-Pastur Distribution
Ledoit-Wolf Shrinkage (small q)
The ratio Q = T/N determines the noise floor. For small portfolios with limited history, RMT cleaning provides substantial improvement in out-of-sample covariance estimates. The cleaned matrix retains the information eigenvalues (genuine risk factors) while suppressing estimation error.
Quality Tilt
Pure Sharpe maximization concentrates in a few names and ignores fundamentals. The Standard and Balanced modes therefore optimise a regularised Sharpe objective (8 or more assets; smaller portfolios use the pure Sharpe ratio):
Quality Score
Sector-specific composite in [0, 1]; each metric is mapped to a sub-score in [0, 1] and averaged with the weights below (weights of missing metrics are dropped and the rest renormalised). Percent fields are used in their stored units: ROE, ROA, margins and revenue growth as decimals (ROE 118% = 1.18), FCF yield and payout ratio in percent.
| Asset type | Metrics (weight) |
|---|---|
| ETF | yield (0.40), 52w momentum (0.35), max drawdown (0.25) |
| Finance | ROE (0.25), ROA (0.15), P/E (0.15), P/B (0.10), FCF yield (0.15), payout (0.10), momentum (0.10) |
| Other stocks | current ratio (0.10), gross margin (0.10), operating margin (0.10), ROE (0.15), ROA (0.05), P/E (0.10), D/E (0.10), interest coverage (0.05), FCF yield (0.10), revenue growth (0.05), payout (0.05), momentum (0.05) |
| QUALITY_THRESH | 0.45 (portfolio quality below this is penalised) |
CVaR Optimization
For multi-asset portfolios including options and non-linear instruments, mean-variance optimization is inappropriate. MAISNER uses Conditional Value-at-Risk (CVaR) minimization via linear programming.
CVaR Definition
Correlated Scenario Generation
| Parameter | Value |
|---|---|
| Scenarios | 5,000 |
| Alpha | 0.95 |
| Method | LP (linear programming) |
| Correlation | Cholesky on RMT-cleaned Σ |
Monte Carlo Simulation
Long-horizon wealth projections for the Optimizer, Analyzer and Constrained engines simulate the value of the (rebalanced) portfolio as a single Geometric Brownian Motion, with the portfolio volatility from the RMT-cleaned covariance matrix — correlations enter through σp = √(wᵀΣw).
Which μ is simulated
Everywhere else in MAISNER the expected return of an asset is its trailing 5-year price CAGR. That is a reasonable ranking input for the optimizer, but as a 10-year forward drift it extrapolates an exceptional half-decade: a conservative large-cap book with a 19.9% trailing CAGR projected a ×6.8 median and a 0.0% probability of loss over ten years (×34 for an aggressive book). No forecaster would sign that. The simulation therefore uses the return the market is compensated for bearing the book's systematic risk; the same book projects μ ≈ 7.6%, median ≈ ×2.0, P(loss) ≈ 4%. The historical CAGR is still shown next to the simulation (μ HIST 5Y) for comparison, but it is not simulated. A book with β ≈ 0 (e.g. market-neutral) is projected at the risk-free rate — any alpha is deliberately not extrapolated.
| Parameter | Value |
|---|---|
| Draws | 10,000 (terminal value, exact lognormal) |
| Horizon | 10 years |
| Drift | CAPM: rf + βp × 5% (historical CAGR shown, not simulated) |
| Output | 5th / 50th / 95th percentile |
| Metrics | P(loss), P(2×), Median@10y, Range |
Stress Testing
Three engines share one category model: a historical replay on monthly closes, a category-impact estimate for any of the 53 catalogued crises, and a custom scenario builder.
Category of a position
Each position is mapped to one category: first by asset class (bond ETFs → bonds, high-yield ETFs → high_yield, gold ETFs → gold, broad indices → equities, regional ETFs → em / europe / uk / china / japan), otherwise by its sector, with the industry separating banks and insurers inside Financials. The crisis impact is then looked up along a fallback chain — e.g. banks → financials → equities, telecom → media → equities. Bonds, high yield, gold and commodities never inherit the equity shock: if a crisis has no entry for their class they are held flat and the breakdown says so.
Historical replay (monthly closes)
With every position covered the chart is the actual buy-and-hold value of the book month by month, V(t) = 1 + Σ wi(Pi(t)/Pi(base) − 1): the max drawdown is realised and the recovery time runs from the start of the crisis until V is back at 1 on the closes after it (not recovered if it never is within the data).
Category-impact estimate and illustrative path
| Crisis | Window | T (y) | σ | Equities | Other categories |
|---|---|---|---|---|---|
| Global Financial Crisis (2007–2009) | 2007-10-01 → 2009-03-01 | 1.5 | 50% | -55% | financials -60%, banks -70%, technology -40%, energy -30%, bonds +10%, real_estate -35%, consumer -40%, industrials -45% |
| COVID-19 Crash (2020) | 2020-02-01 → 2020-04-01 | 0.2 | 60% | -35% | technology -30%, energy -50%, travel -60%, bonds +5%, healthcare -5%, defense +10%, consumer -40% |
| Inflation Shock (2022) | 2022-01-01 → 2022-10-01 | 0.8 | 30% | -20% | technology -25%, energy +10%, bonds -15%, commodities +25%, financials -12%, banks -10% |
| Dot-Com Bubble (2000–2002) | 2000-03-01 → 2002-10-01 | 2.6 | 40% | -45% | technology -75%, financials -20%, telecom -50%, media -60%, consumer -30% |
| SVB Collapse (2023) | 2023-03-01 → 2023-03-31 | 0.1 | 40% | -10% | financials -25%, banks -30%, technology -5% |
Advanced Stress — Custom Shocks
Per position the first match wins: a ticker shock, a sector shock (along the same category chain, so a Financials shock reaches banks), the base crisis impact, then the market shock — which applies to equity-like categories only; bonds, gold and commodities move only when shocked explicitly. Spillover adds λ × Σ (shocks of the other shocked sectors) to equity-like positions, excluding the sector chain the position already took. The path is the same Brownian bridge with the scenario σ and T.
Leverage Analysis
The Leverage Analyzer quantifies the risk and return impact of applying financial leverage to a portfolio. It combines the Kelly Criterion for optimal leverage sizing with continuous-time volatility decay, margin call analytics, and Monte Carlo liquidation probability.
Kelly Criterion — Optimal Leverage
Drawdown Leverage Cap (Paleologo)
Leveraged Return and Volatility
Volatility Decay (Continuous-Time Drag)
Margin Call Threshold
Monte Carlo Liquidation Probability
MAISNER simulates 5,000 GBM paths of the unleveraged portfolio over 252 trading days and checks them against the margin-call barrier every day. The loan accrues margin interest, so the barrier rises over the year: a book that is safe today can be called later at the same price.
Historical Stress Scenarios
| Scenario | S&P 500 Drawdown | Applied to Leveraged Portfolio |
|---|---|---|
| 2008 GFC | −56.8% | DD × L (floored at −100% of equity), then check MC threshold |
| 2020 COVID | −33.9% | DD × L, then check MC threshold |
| 2022 Rate Shock | −25.4% | DD × L, then check MC threshold |
| 2000 Dot-com | −49.1% | DD × L, then check MC threshold |
| 1987 Black Monday | −22.6% | DD × L, then check MC threshold |
The equity loss is L × shock, floored at −100%: a margin account is called long before its equity goes negative, and a loss beyond equity needs a price gap through the call. A row that reaches −100% is marked WIPED (e.g. GFC at 3×: −170% unfloored).
| Parameter | Value | Description |
|---|---|---|
| MC_PATHS_LEV | 5,000 | GBM paths for liquidation probability |
| MC_HORIZON_LEV | 252 days | 1-year daily simulation |
| US Maintenance | 25% | FINRA Rule 4210 maintenance margin (of current position value) |
| EU Maintenance | 25% | Professional clients (broker-set); 50% is the ESMA retail initial margin, not maintenance |
| Leverage range | 1× – 3× | Table computed at 1.0, 1.5, 2.0, 2.5, 3.0 |
Stop Loss Calculator
The Stop Loss Calculator derives position-level and portfolio-level exit thresholds from the volatility structure of the portfolio. The methodology follows Giuseppe Paleologo's Advanced Portfolio Management (2021), which frames stop-loss placement as a statistical inference problem rather than an ad-hoc rule.
Position-Level Volatility Stop
Each position's stop is calibrated to its realised volatility (from the RMT-cleaned covariance diagonal) and the chosen horizon. The parameter k controls the width — how many volatility-adjusted standard deviations separate entry from exit.
Portfolio Drawdown Limit
The portfolio-level stop integrates correlation structure via the full covariance matrix, capturing diversification effects that position-level stops ignore.
Sharpe-Adjusted Stop
A strategy with a genuine edge is expected to be ahead after T, so a given loss is stronger evidence against it than against a zero-edge random walk: the higher the Sharpe, the tighter the limit. The formula is Paleologo's drawdown condition (Advanced Portfolio Management, §10.1, footnote 2 to eq. 10.3) solved for the loss level instead of the leverage, with the annual horizon generalised to T.
GBM First-Passage Barrier Probability (Analytical)
The probability that a position touches its stop before the horizon is computed analytically using the reflection principle for Geometric Brownian Motion — no Monte Carlo required.
Kelly Connection
The Kelly Criterion provides a natural consistency check: a stop that implies a maximum loss exceeding the Kelly-optimal risk budget is oversized relative to the strategy's edge.
Re-Entry Level
After a stop is triggered, the re-entry level accounts for the short-term mean-reversion noise band estimated as 0.5-σ over 5 trading days.
| Parameter | Values | Description |
|---|---|---|
| k_multiplier | 1.5 / 2.0 / 2.5 | Stop width in daily-vol units × √T |
| horizon_days | 30 / 60 / 90 | Horizon for √T scaling |
| confidence α | 0.90 / 0.95 / 0.99 | VaR confidence level (parametric) |
| RF | 3.80% | Risk-free rate (Kelly denominator) |
| Covariance source | RMT diagonal | Per-ticker variance from Marchenko-Pastur cleaned Σ |
Options Pricing
European Options — Black-Scholes
American Options — Barone-Adesi Whaley (BAW)
American-style options cannot be priced with Black-Scholes due to early exercise. MAISNER implements the Barone-Adesi Whaley approximation, which provides a closed-form solution by decomposing the American option into a European component and an early exercise premium.
Implied Volatility
When live market prices are available, MAISNER back-calculates implied volatility using Brent's method — a bracketed root-finding algorithm that is guaranteed to converge. If the IV calculation fails (e.g., deep ITM/OTM with negligible time value), the platform falls back to historical volatility.
Bond Analytics
Price, Duration and Convexity
Vasicek Interest Rate Model
Bond returns in stress scenarios and portfolio projections use the Vasicek mean-reverting short rate model for interest rate simulation.
| Parameter | Value |
|---|---|
| BOND_MAX | 60% of portfolio |
| CONVEXITY_THRESH | 0.05 |
| Credit ratings | AAA → CCC (FMP data) |
Factor Analysis
The Factor Explorer computes Information Coefficient (IC) and related statistics for 11 cross-sectional factors.
Information Coefficient
Information Ratio
| Factor | Category |
|---|---|
| momentum_12m | Momentum (12-1) |
| momentum_1m | Short-term reversal |
| value_composite | P/E, P/B, EV/EBITDA |
| quality_composite | ROE, margins, debt |
| low_volatility | 12-month realised vol |
| fcf_yield | FCF / Market cap |
| earnings_revision | EPS estimate changes |
| size | Log market cap |
| dividend_yield | Trailing dividend yield |
| growth_composite | Revenue + EPS growth |
| short_interest | Short % of float |
Backtesting & Probabilistic Sharpe Ratio
Point-in-Time Simulation
The strategy is a fixed rule (select · weight · rebalance) — nothing is fitted. At the end of each month t the rule ranks the assets on prices up to and including t and the new weights earn month t+1. The first decision needs a full 12-month lookback; an asset is eligible only once it has 12 months of history. Between rebalances the weights drift with prices (buy-and-hold), and every rebalance pays the transaction cost on the turnover Σ|wnew − wdrifted|. Benchmark: equal weight of the assets that have a return in the month, rebalanced monthly.
In-Sample / Out-of-Sample Split
The history is split (default 60 / 40) for reporting: Sharpe, return, volatility and drawdown are shown for the first part (IS), the second part (OOS) and the whole period, at the user's risk-free rate. Because the rule is fixed, the split matters when you tune the rule on IS and then look at OOS — a large IS→OOS drop is the overfitting signal.
Probabilistic Sharpe Ratio
Performance Attribution
MAISNER implements the Brinson-Hood-Beebower (BHB) three-effect decomposition, which explains the difference between portfolio return and benchmark return as the sum of allocation, selection, and interaction effects. The benchmark is a sector blend: the benchmark ETF's sector weights at the start of the period times the returns of the SPDR sector ETFs. The attribution is a single-period, buy-and-hold decomposition in USD total returns.
Brinson-Hood-Beebower Decomposition
Let wp = portfolio sector weight, wb = benchmark sector weight, Rp = portfolio sector return, Rb = benchmark sector return, Rbtotal = total benchmark return.
Portfolio Returns and Weights
Each position's return is the total return (adjusted close, dividends reinvested) from the first trading day on or after the period start to the latest close, converted to USD: \( r_i^{\$} = (1+r_i^{\text{local}})(1+r^{FX}_i) - 1 \), where \( r^{FX} \) is the change of the listing currency's USD rate (Yahoo {CCY}USD=X) over the same window; the currency is that of the listing (London pence → pounds). A position without a price within 10 days of the start (listed later) or without a price in the last 10 days is excluded and named in the result; the remaining weights are rescaled. Duplicate tickers are summed.
Benchmark Construction (SPY, QQQ)
topHoldings.sectorWeightings, 24-hour cache); dividing by each sector's growth over the window rolls a cap-weighted index back to its weights at the start. \( R_s^b \) is the total return of the SPDR sector ETF (XLK, XLV, XLF, XLY, XLI, XLC, XLP, XLE, XLB, XLU, XLRE). If the live breakdown is unavailable, fixed approximate weights are used and the result says so. If any sector ETF has no price, the run stops with an error rather than using 0.EFA and AGG
No sector split. There is no liquid sector return series for MSCI EAFE (US sector ETFs measure US sectors), and AGG is a bond index without equity sectors. The result is the total active return \( R^p - R^{\text{ETF}} \) and the per-ticker table.
Sector Resolution
The same enriched map is used across the Optimizer, Constrained Optimizer, Stress Tests and Attribution: FMP profile first, the Stocks.xlsx sector next (exact name mapping, no substring matching), the ambiguous consumer class split per ticker into Consumer Staples / Consumer Discretionary. Sector ETFs map to their own sector (XLK → Technology); bond, commodity and broad-market ETFs map to "Other".
Portfolio Monitor
The Portfolio Monitor provides real-time P&L tracking, currency exposure breakdown, and option expiry management for user-defined portfolios. Unlike the Analyzer and Optimizer, the Monitor supports multi-asset portfolios (stocks, ETFs, bonds, options, futures, crypto) for all subscription tiers.
Position-Level P&L
Base currency is USD. For position i: q = quantity, m = multiplier (1; options 100; futures the contract multiplier), P0 = purchase price and P = live price, both in the listing currency C; X0 = USD per unit of C at the close of the purchase date, X = today's rate.
Prices and FX rates
Live prices: FMP when it answers, otherwise the Yahoo live quote (v7), otherwise the last Yahoo daily close (the row names its source); crypto as the XXX-USD pair (never FMP's "BTC", a different token). FX: Yahoo {C}USD=X live quote for every currency; FMP for any main currency still missing; then the last live rate saved on disk; the April-2026 constants only as a last resort. Every response lists each rate with its source, and the screen flags any rate that is not live.
Option Valuation
Currency Exposure
Currency is the currency of each listing, read from the exchange quote (ASML.AS → EUR, NESN.SW → CHF, IUSA.SW → USD; a London line quoted in pence (GBp) is divided by 100 to pounds). A ticker without an exchange suffix is the US listing (USD) — see Tickers & Listings. The breakdown shows each currency's share of gross exposure.
Long/Short Optimizer
The Long/Short Optimizer extends the standard MVO framework to allow negative portfolio weights (short positions). The mathematical structure is identical to the long-only case — the same Sharpe objective, the same RMT-cleaned covariance matrix — with two key adaptations: a borrow cost term subtracted from the expected return of shorted positions, and relaxed weight bounds that permit negative values.
Portfolio Modes
Two net-exposure configurations are available:
- Long/Short (net = 1): Σwᵢ = 1. Standard fully-invested portfolio allowing some short positions. Long gross > net; short gross < long gross.
- Market Neutral (net = 0): Σwᵢ = 0. Dollar-neutral — long exposure equals short exposure. A minimum gross constraint (Σ|wᵢ| ≥ 0.5) prevents the degenerate all-zero solution.
Borrow Cost Adjustment
Objective Modes
| Mode | Objective | L/S Adaptation |
|---|---|---|
| Standard | max (μ_eff − η·r_f) / σ | Sharpe of the excess return (see below); bounds [−max_short, max_long] |
| Conservative | min wᵀΣw | Minimise portfolio variance; negative weights allowed; tends toward fewer shorts |
| Balanced | max Sharpe s.t. σ ≤ vol_cap | SLSQP vol constraint; falls back to min-variance if vol_cap is infeasible |
| Aggressive | max μ_eff | Pure return maximisation; bounds widened to [−1.5×max_short, 1.5×max_long] |
| Dividend | max Σ wᵢ×ROIᵢ − 0.3σ | Net dividend income: a short position pays the dividend to the lender, so shorting a high-yielder costs income; vol penalty prevents pure high-yield concentration |
Weight Constraints
Portfolio Statistics
Volatility and Sharpe (identical to long-only)
10-Year Monte Carlo
Upper Barrier Probability for Short Stop-Losses
When L/S portfolio weights are passed to the Stop Loss Calculator, short positions (w < 0) use the upper barrier formula (stop triggered when price rises above entry):
Long/Short Analyzer
The Long/Short Analyzer evaluates an existing L/S portfolio given the user's actual positions — ticker, quantity, direction, and purchase price. Live prices are fetched at run-time to compute current mark-to-market values, realised P&L, and forward-looking risk metrics using the same RMT covariance infrastructure as the optimizer.
Position Valuation and P&L
Portfolio Exposure
Portfolio Risk (RMT Covariance)
Risk Contribution
Stress Scenarios (Beta-Adjusted)
Hedging Optimizer
Builds on Yu & Sun (2017), "Optimal Hedging with Options and Futures against Price Risk and Background Risk", Math. Comput. Appl. 22(1):5: puts and futures are optimised jointly to minimise the Expected Shortfall of the hedged position. The formulas below are the ones the engine runs (revised November 2026; changes from the earlier version are listed at the end of this section).
Hedge P&L per Unit Held
| Symbol | Meaning |
|---|---|
| F0, FT | Futures (forward) price today and at the horizon. The short-futures leg pays F0 − FT: F0 is already the forward price, so no further carry is applied. |
| Kp, Kc | Put and call strikes (Kc = ∞ when there is no call leg) |
| Φp, Φc | Black-76 premia on F0, financed at r until expiry (factor erτ) |
| h | Option units per unit held |
| H | Short futures units per unit held, H ∈ [0, 2] |
| r, τ | Risk-free rate (3.80%), horizon in years (days / 365) |
Option Pricing — Black-76
For an index ETF with F0 = S0·erτ (no dividend yield) this is identical to Black-Scholes on the spot S0. The hedge-instrument volatility σf is used.
Budget — a Ceiling, Not a Target
Premium spent is at most d of the position value. h is searched on 9 equally spaced points of [0, hmax]; when the structure costs nothing or earns a credit (collar) only the cap applies. Forcing the full budget to be spent made the optimizer buy options on up to 2× the notional or deep in-the-money puts (a costly synthetic short future); the cap and the ceiling remove both.
Simulation
N = 10,000 paths from three independent N(0,1) variates W1, W2, W3:
Fstart = F0 in single-asset mode; in portfolio mode Fstart = S0, because a futures contract expiring at the horizon converges to the spot (FT = ST).
Moment matching. Before use the 10,000×3 draws are centred and whitened, W ← (W − W̄)·L−T with LLT = cov(W), so their sample mean is exactly 0 and their sample covariance exactly I. The raw seed-42 draws had column means of +1.7 standard errors, which put the simulated E[ST] 2.4 SE above S0eμτ and biased every mean-based figure (expected hedge cost, mean loss, the tie-break). After matching, the simulated E[ST] is within 0.001 SE of the closed form and the sample correlation equals ρ1 exactly.
Terminal Wealth and Risk Measure
α is the tail probability (defaults to 1 − the user's CVaR confidence level). In the single-asset model Z is a relative shock: β = 0 adds Z·W0, β = 1 scales the whole hedged position by (1 + Z). The portfolio model has no background term: PT already carries the portfolio's full volatility, and its imperfect correlation ρ1 with the hedge instrument is exactly the risk an index hedge cannot remove.
Portfolio Mapping
| Model parameter | Portfolio quantity | Notes |
|---|---|---|
| S0 = P0 | Last hedge-instrument price in price_history | Portfolio expressed in hedge units |
| Q | W0 / S0 | |
| σs | σportfolio | Annualised from all aligned monthly log-returns |
| σf | σhedge | Annualised from the hedge instrument's monthly log-returns |
| ρ1 | corr(portfolio, hedge) | Monthly returns |
| βp | ρ1·σportfolio/σhedge | |
| μs | rf + βp·5% | CAPM with the hedge instrument as market proxy |
| μf | rf + 5% | Real-world drift of the index: a short hedge gives up the equity risk premium |
| F0 | S0·erτ | Forward / futures price |
Portfolio returns use the saved weights, shorts included (normalised by net exposure, or by gross exposure when the book is close to market-neutral). Months in which any holding lacks a price are dropped, never forward-filled — forward-filling a stale tail would insert flat 0% months and understate volatility. Tickers with fewer than 24 monthly prices are excluded from the statistics.
Strategies and Search Grids
| Strategy | Structure | Grid |
|---|---|---|
| Protective Put | Long put, H = 0 | Kp ∈ [0.80, 1.00]·F0 (15) × h (9) |
| Collar | Long put + short call, H = 0 | Kp ∈ [1−s, 1]·F0, Kc ∈ [1, 1+s]·F0 (12 each) × h (9), s = max(0.18, 2σf√τ) |
| Futures Only | Short futures, h = 0 | H ∈ [0, 2] (21) |
| Put + Futures | Long put + short futures | Kp ∈ [0.75, 1.05]·F0 (13) × H (21) × h (9) |
A protective put is insurance, so its strike stops at the money; above it the position is a synthetic
short future, which Put + Futures and Futures Only already cover. The result is flagged
at_grid_edge when the optimum lands on an artificial bound (deepest OTM put, highest call,
H = 2).
Choosing the Best Strategy
Strategies within 0.1pp of the lowest ES are statistically indistinguishable at 10,000 paths; among them the one with the best expected outcome is recommended. No strategy is recommended if none beats the unhedged ES.
Reported Costs
| Field | Definition |
|---|---|
| Option contracts | ⌈h·Q / 100⌉ |
| cost_usd | contracts × 100 × (Φp − Φc) — negative = net credit |
| Futures notional | H·Q·F0; for SPY also shown as E-mini (≈ notional / (500·S0)) and Micro E-mini (×10) |
| exp_hedge_pnl_pct | E[Lossunhedged] − E[Losss] — the expected cost of the protection over the horizon |
| es_reduction_pp | ESunhedged − ESs |
Execution Ticket (HEDGE-ORDER // EXECUTE)
Every strategy gets a ticket; the recommended one is shown first and a click on any row of the strategy table shows the others. All figures are computed in the engine and validated (Module 28).
| Block | Figure | Definition |
|---|---|---|
| Order | Moneyness | vs the forward: ATM-fwd if |ln(K/F0)| < 0.5%; distance ln(K/F0)/(σf√τ) in σ |
| Rounding | contracts ⌈hQ/100⌉; MES = round(HQ/50) (1 MES ≈ 50 × SPY forward); ES recomputed with the traded sizes | |
| Model | Basis risk | σp√(1−ρ12)√τ — the part no index hedge removes |
| Exposure | $ delta | portfolio b·V with b = ρ1σp/σf; puts N(d1)−1, calls N(d1) per option × traded units × S0; futures −traded notional |
| Effective hedge | −(hedge $ delta) / (b·V) | |
| Γ, vega, θ | Γ·S02·1% (change of $ delta per 1% move), vega per vol point, θ per calendar day; Black-Scholes on S0 ≡ Black-76 on F0 | |
| Cost | Expected hedge P&L | closed form: H·Q·(F0 − S0eμfτ) + h·Q·(EP[put] − EP[call] − net·erτ), EP = Black formula on the real-world forward S0eμfτ; shown next to the simulated mean ± 2 SE |
| Breakeven | hedge-instrument price at expiry where the hedge P&L = 0 (payoff is non-increasing in FT; unique root by bisection) | |
| Variation margin | −H·Q·F0·10% for an immediate +10% move | |
| Risk | ES ± SE | paired bootstrap, 200 resamples of the 10,000 losses (same resample for unhedged and hedged) |
| P(loss > 10%) | share of simulated paths, before and after | |
| Scenarios | Unhedged | E[PT | ST] = P0exp(mp + b(x − mh) + ½σp2τ(1−ρ12)), x = ln(ST/S0), m = (μ − σ2/2)τ (bivariate lognormal) |
| Hedge | exact payoff Q·L(ST) | |
| Alternatives | ES gap ± 2 SE | paired bootstrap of ESother − ESthis; a gap below 2 SE is reported as a statistical tie |
| Size 50% / 75% | ES with h and H scaled; expected P&L scales linearly | |
| Notes | Staleness | flag when the hedge price is older than 30 days |
Sensitivity Analysis
| Series | What it shows |
|---|---|
| ES vs budget d | Best strategy's strikes and H fixed, h re-optimised under each ceiling (1%–30%). A flat line means the budget does not bind. |
| ES vs horizon | 30–360 days, paths re-simulated, strikes at the same moneyness K/F0, h re-optimised. |
| Single-asset only: β, d, α, σspot | With / without futures. The σspot sweep re-simulates the spot only; options stay priced on σf. |
Changes in the November 2026 Revision
| Before | Now | Effect on a 90-day, σ = 16.8% test portfolio |
|---|---|---|
| Portfolio mode added background Z with σz = σp√(1−ρ12), not scaled by √τ | No background term in portfolio mode; √τ scaling in single-asset mode | Unhedged ES 18.8% → 14.1% (closed-form lognormal: 14.3%) |
| Additive background term in dollars ((1−β)·Z) | (1−β)·Z·W0 | Single-asset additive background was ≈ $0.05 on $100k |
| Budget always fully spent, h = d·P0/Φ | Ceiling with h ≤ max(1, βp) | Protective put 1.97× → 1.00× notional; best-strategy premium $57k → $4.5k |
| Hedge instrument drift rf; futures leg F0erτ − FT | Drift rf + 5%; futures leg F0 − FT | Expected cost of a 0.8× futures hedge now 1.15% of AUM per quarter (was ≈ 0) |
| Black-Scholes with F0 as spot | Black-76 on F0 | Removes a double carry of F0(erτ−1) |
| Collar: credit reported as $0, cost = put premium | Signed net premium | Credit collars now show their credit |
| Best = lowest ES, any margin | Lowest expected loss within 0.1pp of the lowest ES | No recommendation on a 0.002pp edge |
| Stale prices forward-filled; shorts dropped | Missing months dropped; shorts kept | σp no longer biased low by fake 0% months |
| Raw seed-42 normal draws (column means +1.7 SE) | Moment-matched draws (mean 0, covariance I) | Simulated E[ST] 2.4 SE high → within 0.001 SE; unhedged mean return 2.25% → 2.10% (closed form 2.098%) |
Base Currency (USD)
Every return, volatility, correlation and expected return on the platform is that of a US-dollar investor. A listing that trades in another currency is converted before any statistic is computed, so its currency risk is part of its risk.
Tickers & Listings
Every request passes through one resolver before any engine runs, so all tools, saved portfolios, Monitor books and alerts use the same listing.
| Input | Listing used |
|---|---|
| No suffix (SAP) | US listing (SAP SE ADR, NYSE, USD) |
| Exchange suffix (SAP.DE) | That exchange (Xetra, EUR) — Yahoo Finance suffixes |
| Not traded where asked | Most traded listing of the same symbol on another exchange — announced with company, exchange and currency |
| US class share with a dot (BRK.B) | BRK-B |
| Option, future (=F), index (^), FX (=X), crypto, bond | Unchanged |
Currency of a position = currency of its listing as quoted by the exchange (an ETF can trade in another currency than its exchange: IUSA.SW is quoted in USD). London lines quoted in GBp are converted to pounds.
Platform Constants
| Constant | Value | Description |
|---|---|---|
| RISK_FREE | 3.80% | Risk-free rate (annualised) |
| WEIGHT_MAX | 35% | Max weight per linear asset |
| CRYPTO_MAX | 15% | Max total crypto allocation |
| FUTURES_MAX | 20% | Max total futures allocation |
| BOND_MAX | 60% | Max total bond allocation |
| OPTION_MAX | 30% | Max total options allocation |
| QUALITY_THRESH | 0.45 (MVO) · 0.30 (multi-asset) | Portfolio / per-asset quality below this is penalised |
| Quality penalty | 0.15 (MVO) · 0.05 (constrained, multi-asset) | Weight of the quality term in the objective |
| Entropy penalty | 0.30 | MVO Standard / Balanced diversification term |
| MC_PATHS | 10,000 | Monte Carlo simulation paths |
| MC_HORIZON | 10 years | Monte Carlo time horizon |
| CVAR_SCENARIOS | 5,000 | CVaR scenario count |
| CVAR_ALPHA | 0.95 | CVaR confidence level |
| DATA_HISTORY | 10 years | Price history for analysis |
| STALENESS | 30 days | Max data age before refresh |
Data sources: FMP Professional (primary — fundamentals, prices, dividends), Polygon (secondary — US equities), yfinance (EU tickers, fallback). All data fetched over HTTPS with API key authentication.
PRIIPs KID Generator
Implements EU Regulation 1286/2014 (PRIIPs) and Commission Delegated Regulation 2017/653 as amended by Delegated Regulation 2021/2268 (applicable from 1 January 2023). A portfolio of listed equities and ETFs is a Category 2 PRIIP (linear exposure, observable prices). The calculation uses the monthly closes of the holdings as a composite benchmark of the portfolio (Annex IV point 14). It requires at least 5 years of monthly prices (Annex II point 10) and, for the scenarios, 10 years of history when the recommended holding period (RHP) is up to 5 years, RHP + 5 years otherwise (Annex IV point 6); a KID draft is not produced for a holding period the price history cannot support.
Market risk — VEV and MRM (Annex II, points 9-15)
| MRM | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| VEV | < 0.5% | 0.5–5% | 5–12% | 12–20% | 20–30% | 30–80% | ≥ 80% |
Each band includes its lower bound. Because only monthly prices are available, the MRM class is raised by one additional class (Annex II point 15).
Summary Risk Indicator (Annex II, Part 3, point 52)
| CRM \ MRM | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 3 | 3 | 3 | 3 | 4 | 5 | 6 | 7 |
| 4 | 5 | 5 | 5 | 5 | 5 | 6 | 7 |
| 5 | 5 | 5 | 5 | 5 | 5 | 6 | 7 |
| 6 | 6 | 6 | 6 | 6 | 6 | 6 | 7 |
CRM = 1 for directly held equities and ETFs; higher classes apply to products carrying issuer credit risk.
Performance scenarios (Annex IV points 6-11, 32-36)
Columns shown: 1 year and the RHP; a mid-point column only for an RHP of 10 years or more.
Costs (Annex VI points 61-71)
Multi-Asset Optimizer
Extends the core MVO engine to portfolios containing equities, ETFs, futures, crypto, bonds, and options simultaneously. Each asset class is handled by a dedicated sub-optimizer; results are stitched into a single set of weights subject to class-level allocation caps.
Asset Class Constraints
| Class | Cap | Treatment |
|---|---|---|
| Equities / ETFs / Crypto | 35% per ticker · 15% total crypto | Standard MVO with RMT cleaning |
| Bonds | 60% total | Returns from real Treasury yield changes → MVO |
| Futures | 20% total | Linear payoff → included in MVO |
| Options | 30% total | Scenario-based CVaR-LP |
Data and Expected Returns
Individual Bonds — Real Treasury Yields
Modes and the Whole-Book Figures
Options Sub-Optimizer — CVaR Linear Programme
Combined Portfolio Metrics
Portfolio Analyzer
Holdings-based workflow: enter current positions as (ticker, shares) pairs, and the engine computes current portfolio metrics, runs a full MVO re-optimization, and produces a rebalancing plan with trade-level cost estimates.
Holdings → Weights
Rebalancing Plan
Comparison Metrics
| Metric | Formula |
|---|---|
| Sharpe | (μ − r_f) / σ |
| Sortino | (μ − r_f) / σ_down, σ_down = √(E[min(r,0)²] × P), P = bars per year of the return series: 12 for the 24 monthly returns used on the platform (252 only for daily data) |
| Beta | Cov(r_p, r_SPY) / Var(r_SPY) |
| Alpha (Jensen) | μ_p − r_f − β(μ_SPY − r_f) |
| Max Drawdown | max(V_peak − V_trough) / V_peak over the last 24 monthly closes (intra-month troughs are not seen, so it understates a daily max drawdown) |
Advanced Stress Test — Custom Scenarios
Extends the historical scenario library with a fully configurable shock constructor. The user specifies a base crisis (optional), market-wide shock, per-sector shocks, and per-ticker overrides. A GBM path is generated to visualise how portfolio value evolves through the scenario.
Shock Priority Chain
GBM Path Generation
Options Strategy Builder
Assembles multi-leg options strategies from a ticker, spot price, implied volatility, and expiration date. Each strategy is defined as a set of legs with direction (+1 long / −1 short), option type, and a delta target used to select the appropriate strike.
Supported Strategies
| Strategy | Legs | View |
|---|---|---|
| Covered Call | Long stock + short OTM call (Δ≈0.30) | Neutral-bullish, income |
| Protective Put | Long stock + long OTM put (Δ≈−0.25) | Bullish with downside insurance |
| Collar | Long stock + short OTM call + long OTM put | Bounded risk and reward |
| Long Straddle | Long ATM call + long ATM put | Volatility long, direction neutral |
| Long Strangle | Long OTM call (Δ≈0.25) + long OTM put (Δ≈−0.25) | Vol long, cheaper than straddle |
| Bull Call Spread | Long ATM call + short OTM call (Δ≈0.30) | Bullish, defined risk/reward |
| Bear Put Spread | Long ATM put + short OTM put (Δ≈−0.30) | Bearish, defined risk/reward |
| Short Straddle | Short ATM call + short ATM put | Sell volatility, range-bound |
| Iron Condor | Short OTM call spread + short OTM put spread | Low-vol income, 4 legs |
Strike Selection via Delta Targeting
Portfolio Greeks Aggregation
Tax Loss Harvesting
For each lot i: q = shares, P0 = purchase price and P = live price in the listing currency, X0 = USD per unit of that currency at the purchase date (Yahoo daily close), X = today's rate. All amounts are in USD.
Which lots a sale realises
Taxable loss and this year's saving
Signal Analysis
Evaluates each factor from the Factor Library as a standalone trading signal over forward periods of 1, 3, 6, and 12 months. Produces Information Coefficient, hit rate, long/short spread, and t-statistics. Supports ensemble composite construction via OLS signal combination.
Information Coefficient (IC)
Hit Rate & Long/Short Spread
Ensemble Composite
Efficient Frontier
Generates the mean-variance efficient frontier by Monte Carlo sampling of random portfolios, then renders an interactive scatter chart. Clicking any point populates weight sliders; dragging a slider instantly recomputes portfolio metrics for the custom allocation.
Random Portfolio Generation
Interactive Metrics
| Metric | Formula | Notes |
|---|---|---|
| Sharpe | (μ − r_f) / σ | Uses RMT covariance |
| Sortino | (μ − r_f) / σ_down | σ_down = downside deviation × √12 (monthly returns) |
| Beta | Σ wᵢ βᵢ | Weighted sum of individual betas vs SPY |
| Quality | Σ wᵢ qᵢ | Weighted quality score (0–1) |