Stop Leaving Money on the Table: A VIX Regime Filter That Lifted My ES/NQ/RTY Results by ~34% (EasyLanguage Code Inside)
Improve risk-adjusted returns on ES/NQ/RTY using a simple VIX filter (code included)
Using the VIX as a regime gate improved my RSI2 Strategy on ES/NQ/RTY by ~34.2752% Ret/DD simply by excluding the High/Extreme regime (Regime 4). It reduces trades in chaotic conditions and smooths the equity curve. Code below; validate on your own data.
If you trade indices such as Russell (RTY), ES, or NQ, I’ve found a simple filter that almost always improves results. I don’t do anything without understanding my edge, and it makes sense that your strategy’s edge will work better in different volatility regimes. The idea here is straightforward: use the VIX as an entry filter.
What is the VIX (and why use it as a filter)?
The VIX is the options market’s implied 30-day volatility for the S&P 500 (often called the “fear gauge”). It’s useful as a filter because:
Behaviour changes with volatility. Low-volatility markets often grind and trend with shallow pullbacks; high-volatility markets gap, mean-revert more violently, and whipsaw.
Regimes cluster. Today’s volatility regime often looks like yesterday’s, making simple conditional rules effective.
Expectancy varies by regime. The same entry can have very different average outcomes depending on the volatility backdrop.
Goal: don’t change your core signal—change where you deploy it.
How I split the VIX into four quadrants (and why)
This filter is dynamic and adapts to the current volatility backdrop:
Look back 100 bars on VIX (as Data2).
Compute the rolling High and Low.
Split that range into four equal bands:
Regime 1: Low
Regime 2: Low–Medium
Regime 3: Medium–High
Regime 4: High/Extreme
You then exclude regimes via a single parameter.
Why regime gating helps strategies
State conditioning: You only take signals when the market state historically supports them.
Variance control: You often get fewer but better trades, smoothing equity and drawdowns.
Risk-adjusted lift: If expectancy differs across regimes, metrics like Ret/DD, PF, Avg Trade can improve just by skipping the worst zone for your setup.
Typical tendencies (validate on your data)
Mean-reversion: Frequently strongest in Low → Medium–High (Regimes 1–3), but often degrades in High (Regime 4) due to gaps/whips and slippage sensitivity.
Breakout/Trend: Often benefits from Medium–High to High (Regimes 3–4) where ranges expand; very low vol (Regime 1) can create false starts.
For MR: allow Regimes 1–3; exclude 4
For Breakout: allow Regimes 3–4; consider excluding 1
Setup (once)
Data1: your index future (
@ES,@NQ,@RTY) on your chosen timeframe.Data2: VIX on the same chart/session (e.g.,
$VIX.Xin TradeStation; use your vendor’s VIX symbol in MultiCharts make sure to run both charts on local time.Run a baseline (filter OFF), then run with filter (filter ON and optimised to see the best regime to exclude.)
Code — Original Strategy (demo only)
//------------------------------------------------------------------
//Strategy: Long when RSI < 20 and price > 190 SMA, Exit when RSI > 80
//------------------------------------------------------------------
inputs:
RSIPeriod( 3 ),
RSILowEntry( 20 ),
RSIHighExit( 80 ),
MovingAvgPeriod( 190 ),
ExitAfterBars( 39 ),
StopLossTicks( 1100 ),
PositionSize( 1 );
vars:
RSIValue( 0 ),
MovingAvg( 0 ),
LongEntry( false ),
LongExit( false );
// Calculate indicators
RSIValue = RSI(Close, RSIPeriod);
MovingAvg = Average(Close, MovingAvgPeriod);
// Entry conditions
LongEntry = (RSIValue < RSILowEntry) and (Close > MovingAvg[1]);
// Exit conditions
LongExit = (RSIValue > RSIHighExit);
// Long Entry
if LongEntry and MarketPosition = 0 then begin
Buy("RSI Long") PositionSize shares next bar at market;
end;
// Position Management
if MarketPosition > 0 then begin
// Stop Loss
if StopLossTicks > 0 then
Sell("Stop Loss") next bar at (EntryPrice - StopLossTicks * MinMove/PriceScale) stop;
// Exit after X bars
if ExitAfterBars > 0 and BarsSinceEntry > 0 and BarsSinceEntry >= ExitAfterBars then
Sell("Time Exit") next bar at market;
// RSI Exit Signal
if LongExit then
Sell("RSI Exit") next bar at market;
end;
Here is what the chart looks like without the $VIX.X added
Here is what the equity of the Strategy looks like without the filter
Code — VIX Regime Filter (standalone; your code verbatim)
Requires VIX as Data2 on the chart (same session/timezone as Data1).
// VIX Regime Filter Inputs
inputs:
UseVolatilityFilter(false), // Toggle to enable/disable VIX regime filter
ExcludeVolRegime(0); // Exclude specific regime (0 = none, 1 = low, 2 = low-med, 3 = med-high, 4 = high)
// VIX Regime Variables
variables:
VIX_High(0),
VIX_Low(0),
Range_Size(0),
Level_1(0),
Level_2(0),
Level_3(0),
Current_Regime(0),
Allow_Entry(true);
// =================================================================
// VIX REGIME CALCULATION (based on Data2)
// =================================================================
VIX_High = highest(Close, 100) of Data2;
VIX_Low = lowest(Close, 100) of Data2;
Range_Size = (VIX_High - VIX_Low) / 4;
Level_1 = VIX_Low + Range_Size;
Level_2 = VIX_Low + (2 * Range_Size);
Level_3 = VIX_High - Range_Size;
// Assign current VIX to regime
If Close of Data2 <= Level_1 then Current_Regime = 1; // Low volatility
If Close of Data2 > Level_1 and Close of Data2 <= Level_2 then Current_Regime = 2; // Low-Medium volatility
If Close of Data2 > Level_2 and Close of Data2 <= Level_3 then Current_Regime = 3; // Medium-High volatility
If Close of Data2 > Level_3 then Current_Regime = 4; // High volatility
// Check if current regime should be excluded
Allow_Entry = true;
If UseVolatilityFilter and Current_Regime = ExcludeVolRegime then Allow_Entry = false;
// =================================================================
// USE IN YOUR ENTRY CONDITIONS
// Add "and Allow_Entry" to your buy/sell conditions
// Example: if [your conditions] and Allow_Entry then buy next bar at market;
// =================================================================Code — Strategy with the VIX Filter Added
//------------------------------------------------------------------
// Simplified EasyLanguage Code for ES MR RSI2 Strategy with VIX Filter
//
// Strategy: Long when RSI < 20 and price > 190 SMA, Exit when RSI > 80
// VIX Filter: Optional volatility regime filter using VIX data
//------------------------------------------------------------------
inputs:
RSIPeriod( 3 ),
RSILowEntry( 20 ),
RSIHighExit( 80 ),
MovingAvgPeriod( 190 ),
ExitAfterBars( 39 ),
StopLossTicks( 1100 ),
PositionSize( 1 ),
// VIX Regime Filter Inputs
UseVolatilityFilter( false ), // Toggle to enable/disable VIX regime filter
ExcludeVolRegime( 4 ); // Exclude specific regime (0 = none, 1 = low, 2 = low-med, 3 = med-high, 4 = high)
vars:
RSIValue( 0 ),
MovingAvg( 0 ),
LongEntry( false ),
LongExit( false ),
// VIX Regime Variables
VIX_High( 0 ),
VIX_Low( 0 ),
Range_Size( 0 ),
Level_1( 0 ),
Level_2( 0 ),
Level_3( 0 ),
Current_Regime( 0 ),
Allow_Entry( true );
// Calculate indicators
RSIValue = RSI(Close, RSIPeriod);
MovingAvg = Average(Close, MovingAvgPeriod);
// =================================================================
// VIX REGIME CALCULATION (based on Data2)
// =================================================================
if UseVolatilityFilter then begin
VIX_High = Highest(Close, 100) of Data2;
VIX_Low = Lowest(Close, 100) of Data2;
Range_Size = (VIX_High - VIX_Low) / 4;
Level_1 = VIX_Low + Range_Size;
Level_2 = VIX_Low + (2 * Range_Size);
Level_3 = VIX_High - Range_Size;
// Assign current VIX to regime
if Close of Data2 <= Level_1 then Current_Regime = 1; // Low volatility
if Close of Data2 > Level_1 and Close of Data2 <= Level_2 then Current_Regime = 2; // Low-Medium volatility
if Close of Data2 > Level_2 and Close of Data2 <= Level_3 then Current_Regime = 3; // Medium-High volatility
if Close of Data2 > Level_3 then Current_Regime = 4; // High volatility
// Check if current regime should be excluded
Allow_Entry = true;
if Current_Regime = ExcludeVolRegime then Allow_Entry = false;
end else begin
Allow_Entry = true;
end;
// Entry conditions
LongEntry = (RSIValue < RSILowEntry) and (Close > MovingAvg[1]);
// Exit conditions
LongExit = (RSIValue > RSIHighExit);
// Long Entry (with VIX filter)
if LongEntry and MarketPosition = 0 and Allow_Entry then begin
Buy("RSI Long") PositionSize shares next bar at market;
end;
// Position Management
if MarketPosition > 0 then begin
// Stop Loss
if StopLossTicks > 0 then
Sell("Stop Loss") next bar at (EntryPrice - StopLossTicks * MinMove/PriceScale) stop;
// Exit after X bars
if ExitAfterBars > 0 and BarsSinceEntry > 0 and BarsSinceEntry >= ExitAfterBars then
Sell("Time Exit") next bar at market;
// RSI Exit Signal
if LongExit then
Sell("RSI Exit") next bar at market;
end;
Here is what the chart looks like with the $VIX.X added
Here is what the equity of the Strategy looks like with the filter
Results (what I saw)
Baseline (no filter): the strategy participates across all regimes, keeping trade count high but exposing the system to whips and gaps in High/Extreme volatility. Ret/DD and Avg Trade suffer, and drawdowns cluster.
With VIX gating (exclude Regime 4): the system skips the most chaotic windows. Trade count drops, Ret/DD improves by ~34.2752% in my test, PF rises, and the equity curve is smoother with shallower, shorter drawdowns.
Your results will depend on instrument, timeframe, and costs—validate on your data.
Quick testing checklist
Start with
UseVolatilityFilter = true, OptermiseExcludeVolRegime.For MR, try allow 1–3. For Breakout, try allow 3–4.
Measure Ret/DD, PF, Avg Trade; watch trade count.
Inspect equity shape and drawdown clustering.
Include realistic commission + slippage.
Confirm OOS on different windows and across ES/NQ/RTY.
What’s next (paid follow-up)
In the next article (paid) I’ll provide a suite of VIX filters with smart switches to choose the best filter based on market characteristics, plus SQX custom blocks to implement VIX filtering in StrategyQuant X and run full robustness testing. If you want that, consider subscribing.
Disclaimer
Educational only. The RSI2 example is a demo harness and not investment advice. Do your own testing and manage risk.






