Skip to main content

Filter entries by Implied Volatility

Use Implied Volatility variables in entry conditions to restrict when a strategy opens new positions. MesoSim exposes underlying_iv_rank and underlying_iv_pct through the Script Engine.

Choose a low- or high-IV filter

Use a comparison in Entry.Conditions to select the volatility environment you want to test. The thresholds below are examples you can adjust.

Enter when IV Rank is high

"Conditions": [
"underlying_iv_rank > 50"
]

This condition allows entry when IV Rank is greater than 50.

Enter when IV Rank is low

"Conditions": [
"underlying_iv_rank < 30"
]

This condition allows entry when IV Rank is below 30.

Enter within an IV Rank range

"Conditions": [
"underlying_iv_rank >= 30 and underlying_iv_rank <= 50"
]

This condition allows entry when IV Rank is between 30 and 50, including both endpoints. Use > or < for strict comparisons, and >= or <= to include the threshold.

Place one of these Conditions arrays inside Entry, keeping your other required fields and any additional entry conditions.

Choose a volatility measure

  • underlying_iv_rank: filter by IV Rank, as in the examples above.
  • underlying_iv_pct: filter by IV Percentile instead. For example, underlying_iv_pct < 30 selects values below the 30th percentile.

See Implied and Historical Volatility for how these measures are calculated. The same variables can also control exits and adjustments, as described below.

Use IV filters for exits and adjustments

IV filters can control when you close or adjust an existing position, as well as when you enter:

  • Exit.Conditions: use an expression such as underlying_iv_rank < 30 to trigger an exit when IV Rank falls below your chosen threshold.
  • Adjustment.ConditionalAdjustments: use an IV expression as the condition for an adjustment. For example, underlying_iv_rank > 50 can trigger your configured adjustment when IV Rank is high.

Use the same low, high, or range comparisons shown above with either IV Rank or IV Percentile. Exit and adjustment conditions are evaluated on their respective schedules.

Apply and test the filter

Open the AI Editor and add the chosen condition to your strategy. For a complete starting example, select [FEAT-Entry-HighIV] from the Strategy Library, then change its condition to target high, low, or a range of IV values.

Conditions are evaluated on the strategy's entry schedule. The built-in example checks each day, 30 minutes before market close; use the schedule appropriate for your strategy.

An entry filter controls new positions. It does not close an existing position when IV leaves the selected range; configure exit rules separately if you want that behavior.

Review and validate the strategy in MesoSim, then run it. Use Clone to change the threshold while keeping other settings the same, and compare the backtest results.

Find more examples in the Strategy Library.