Volatility-Control Index
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/index-and-benchmark-engineering/strategy-indices/volatility-control-index";Signature#
calculate(data)Scales exposure to hold realised volatility near a target, cutting it when markets get rough. Exposure is set from *trailing* volatility, so the mechanism always acts after the fact — it dampens rather than avoids.
Parameters#
| Name | Type | Notes |
|---|---|---|
data | { returns: number[]; lookback: number; annualization: number; targetVolatility: number; maxExposure: number; cashReturn: number; baseLevel: number } | lookback is the realised-volatility window, measured over the returns strictly before the current one, as a sample standard deviation with an n-1 denominator. annualization is the periods-per-year count (252 for daily data) that multiplies the sample variance before the square root. maxExposure caps exposure when volatility is low and is also the exposure used when a window's realised volatility is exactly zero. baseLevel is the index value at the start of the series; it scales the level but never the returns. There is no exposure floor, no rebalance band or trigger, and no separate warm-up parameter: the first lookback observations are given exposure 1 by convention. |
Returns#
{ exposures, strategyReturns, levels, endingLevel }
The exposure actually taken each period alongside the returns — the exposure path is what explains the strategy's behaviour. No turnover, trade, or cost figure is produced.
Errors#
- When lookback < 2, or returns has no more than lookback observations — throws
- When targetVolatility, maxExposure, or annualization is not positive — throws
- When a strategy return drives the index level to zero or below — throws
Complexity: time O(n × lookback),
space O(n).
Worked example#
verified This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.
Input#
{
"returns": [0.004, -0.003, 0.005, 0.002, -0.012, 0.015],
"lookback": 4,
"annualization": 252,
"targetVolatility": 0.1,
"maxExposure": 1.5,
"cashReturn": 0.0001,
"baseLevel": 1000
}Call#
calculate(data)Returns#
object with 4 fields: exposures, strategyReturns, levels, endingLevel
{
"exposures": [1, 1, 1, 1, 1.5, 0.84685],
"strategyReturns": [0.004, -0.003, 0.005, 0.002, -0.01805, 0.012718],
"levels": [1000, 1004, 1000.988, 1005.99294, 1008.004926, 989.810437],
"endingLevel": 1006.077264
}Diagrams#
Calculation flow#
Volatility-Control Index calculation flow
flowchart LR
A["Point-in-time inputs"] --> B["Validate units and timing"]
B --> C{"Contract feasible?"}
C -->|No| D["Reject with reason"]
C -->|Yes| E["Calculate Volatility-Control Index"]
E --> F["Recompute invariants"]
F --> G{"Checks pass?"}
G -->|No| D
G -->|Yes| H["Publish audited output"]
Volatility-Control Index methodology state
stateDiagram-v2
[*] --> FrozenInputs
FrozenInputs --> Validated: contract passes
FrozenInputs --> Rejected: missing or infeasible
Validated --> Calculated: apply named rule
Calculated --> Audited: invariants pass
Calculated --> Rejected: invariant fails
Audited --> Published: version and timestamp recorded
Published --> Revised: approved correction
Revised --> FrozenInputs: rebuild from retained source state
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- S&P Dow Jones Indices Index Mathematics Methodology — S&P Dow Jones Indices
- S&P DJI Equity Indices Policies & Practices — S&P Dow Jones Indices
- FTSE Russell Capping Methodology — FTSE Russell, LSEG
- FTSE Russell Index Policy and Methodology Library — FTSE Russell, LSEG
- MSCI Global Investable Market Indexes Methodology Library — MSCI
- MSCI Minimum Volatility Indexes Methodology — MSCI
- S&P Risk Control 2.0 Indices Methodology — S&P Dow Jones Indices
- Principles for Financial Benchmarks — International Organization of Securities Commissions
- Regulation (EU) 2016/1011 — European Union
- Portfolio Selection — Harry Markowitz
- On the Properties of Equally-Weighted Risk Contributions Portfolios — Sébastien Maillard, Thierry Roncalli, and Jérôme Teïletche
- Fundamental Indexation — Robert Arnott, Jason Hsu, and Philip Moore
- FTSE Currency Hedging Methodology Overview — FTSE Russell, LSEG