Implied and Historical Volatility
MesoSim provides volatility variables for comparing market conditions and defining entry, adjustment, and exit rules. Historical Volatility describes observed price variation; Implied Volatility is derived from option prices.
Available variables
| Variable | Meaning | Scale |
|---|---|---|
underlying_hv | Annualized Historical Volatility of the underlying | Percent: 20 means 20% |
underlying_iv | Underlying Implied Volatility | Percent: 20 means 20% |
underlying_iv_rank | Current IV relative to the lowest and highest reference IV in the lookback | 0–100 |
underlying_iv_pct | Percentage of reference observations with IV strictly below the current IV | 0–100 |
These describe the underlying. For an individual option leg's IV, use the corresponding leg variable in the Script Engine reference.
Historical Volatility
underlying_hv uses 30 available closing prices to calculate daily log returns. MesoSim annualizes their standard deviation using 252 trading days and expresses the result as a percentage. Equity closing prices are adjusted for splits before calculating returns.
Historical Volatility uses closing prices and does not update intraday.
Implied Volatility
underlying_iv summarizes option-implied volatility near the underlying price, using put options with expirations close to 30 days. It can change intraday as the available option data changes.
IV Rank
IV Rank shows where current IV lies within the reference range:
IV Rank = 100 × (current IV − lowest reference IV)
/ (highest reference IV − lowest reference IV)
For example, if the reference low is 10%, the high is 30%, and current IV is 20%, IV Rank is 50. Rank is bounded to 0–100; when the reference range is flat, MesoSim returns 0.
IV Percentile
IV Percentile measures how often reference IV was lower than the current level:
IV Percentile = 100 × reference observations below current IV
/ total reference observations
If 180 of 240 reference observations are below current IV, IV Percentile is 75. Equal values are not counted as lower.
Rank measures location within a range, while Percentile measures frequency. They can give different values for the same current IV.
Lookback and updates
IV Rank and IV Percentile use a one-year lookback of daily reference observations, excluding the current day. The reference history stays fixed during the day, while the metrics can change with current intraday IV.
Use volatility in a strategy
See Filter entries by Implied Volatility for low, high, and range filters. The same variables can be used in Exit conditions and conditional adjustments, evaluated on their respective schedules.
Open the AI Editor to add a filter, then use Clone to change one threshold at a time and compare results. To preserve selected volatility values for later analysis, see Events export.
For historical crypto data, see Crypto Options Simulation (legacy). Find more strategy examples on the Deltaray blog and learn about Deltaray's tools.