How to use the volatility targeting calculator
The page has two tools.
Exposure for a target sizes a position today:
- Target volatility. The annualized volatility you want the position or portfolio to run at.
- Maximum leverage. 1 means never more than fully invested; 2 allows up to twice your capital through margin or futures.
- Capital. The amount the target applies to.
- Current volatility. Enter it directly, or paste daily returns and choose a lookback window and an estimator: a simple standard deviation, or an exponentially weighted moving average (EWMA) that gives recent days more weight. The stock volatility calculator estimates volatility from closing prices.
Backtest on a series shows what the rule would have done. Paste daily returns, set the target, the leverage cap, the lookback and the estimator. The example is 504 fictional daily returns, about two trading years, with a sharp sell-off in the middle.
The formula
The two estimators, over the last n daily returns r:
EWMA: σ̂2 = 252 × Σk λk rt−1−k2 ÷ Σk λk, k = 0 … n − 1The simple estimate is the sample standard deviation. The EWMA estimate assumes a zero mean and weights yesterday's squared return by 1, the day before by λ, then λ², and so on, normalized over the window. λ = 0.94 is the value RiskMetrics popularized for daily data.
In the backtest, day t’s exposure uses returns up to day t − 1 only, and the scaled return is exposure × rt. The first n returns only warm up the estimate, so both series are compared over the same remaining days.
A worked example
Sizing. A $250,000 account wants 12% volatility from an asset currently running at 20%, with leverage capped at 1.5 times. Exposure is 12 ÷ 20 = 60.0%, a position of $150,000, with $100,000 left in cash.
If the asset calmed down to 6%, the uncapped exposure would be 200.0%. The cap holds it at 150.0%, and the position then runs at only 9.00%, below the target.
Backtest. Scaling the 504 example returns to 15% with a lookback of 20 days (simple estimate) and leverage capped at 2 times, the test runs over 484 days. Realized volatility is 16.46% against 17.46% unscaled. The maximum drawdown falls from -30.6% to -16.2%. The annual return is almost unchanged (+10.23% against +10.30%). Average exposure is 134%: above 100% in calm months, as low as 35.1% during the sell-off.
Why volatility targeting works on risk
Volatility clusters. Calm days tend to follow calm days and turbulent days follow turbulent ones, so recent volatility is a usable forecast of volatility over the next days and weeks. Returns are much harder to forecast. A rule that scales exposure by the inverse of recent volatility therefore lines up risk far better than it lines up return.
The backtest shows the effect most clearly in the range of one-month realized volatility. Unscaled, it swings from 5.57% to 42.42%. Vol-targeted, it stays between 9.66% and 28.42%. That stability is the product: a fund, an overlay or a personal portfolio whose risk does not double just because markets became nervous.
The same logic sits inside many institutional strategies: risk parity portfolios scale each asset by its volatility, trend-following funds size positions by recent volatility, and some multi-asset funds state a target volatility as their mandate.
What changes the result most
| Setting | Realized vol | Max drawdown | Sharpe | Annual return |
|---|---|---|---|---|
| Unscaled (20-day window) | 17.46% | -30.6% | 0.65 | +10.30% |
| 20-day simple, 2× cap | 16.46% | -16.2% | 0.67 | +10.23% |
| 20-day simple, no leverage (1× cap) | 12.31% | -15.7% | 0.89 | +10.75% |
| 60-day simple, 2× cap | 16.33% | -18.7% | 0.32 | +3.97% |
| 60-day EWMA, 2× cap | 15.71% | -15.9% | 0.47 | +6.40% |
The 60-day rows test fewer days, because the first 60 returns are used for warm-up; their unscaled Sharpe ratio over the same days is 0.58.
The lookback. A 60-day simple window cuts exposure more slowly as the sell-off starts and keeps it low long after volatility has calmed, so it misses part of the rebound. On this path its Sharpe ratio drops to 0.32. An EWMA over the same 60 days puts most of its weight on the latest weeks and does better. Short windows react faster but trade more: the 20-day rule changes exposure by 4.4% of capital on an average day.
The leverage cap. Without leverage, the rule can only reduce exposure. It cuts risk in bad periods but cannot scale up in calm ones, so realized volatility ends below target at 12.31%. On this sample that version did best on a risk-adjusted basis, but that reflects this one path, not a general rule.
The asset. Vol targeting tends to help most on assets whose bad returns arrive with high volatility, such as equities. On assets where volatility spikes often come with gains, or with sharp reversals, scaling down after a spike can lock in losses and miss the recovery.
What this calculator does not include
- Financing and cash. Leverage costs interest and cash earns it; the backtest ignores both, which flatters leveraged periods when rates are high.
- Trading costs. Daily rebalancing is assumed to be free. Real implementations rebalance only when exposure drifts beyond a band, which lowers costs and adds some lag.
- Gaps and jumps. A sudden shock hits the position at full size before any estimate can react.
- Overfitting. One sample path, one lookback and one target can make any rule look good or bad. Try several settings and other data before drawing conclusions.
- Taxes and portfolio context. A single return series is scaled in isolation; correlations with other holdings are not considered.