7 min read

VIX and Gap Scenario IC Backtest

VIX and Gap Scenario IC Backtest
Photo by Brett Jordan / Unsplash

It's been awhile since I write about backtest because the backtest I've been doing recently is getting more and more complicated ever since I made the per minute OO tool. That tool allowed us to do so much more.

Background

Let's start with some background, it might be complicated to explain but I just want to journal this down for more exposure and drive concrete discussions.

The first context is this - IC tranche strategy. It's been more than a year and yes I'm still refining and trading this, mostly automated with my bot. So this backtest started with my random inspiration of VIX and SPX Gaps.

For this backtest, it's about the concept of having historical reference of VIX and Gaps to get a glimpse of whether there's a pattern to it. Another perspective in more layman terms is with historical reference of VIX and Gaps, everyday before market open we could have this additional information about how potentially 'today' would perform based on that reference.

Hope I don't confuse you, if you do please catch me on discord to discuss more. Always open to discuss with people who're interested in such exploration.

How is the backtest done?

So I mentioned above about the per minute OO tool allowing us to have per minute backtest. Rodrigo and I have been running these per minute backtest on the IC tranche strategy for the past 2-3 years. He runs a 150% stoploss version at $1.1 credit while I run a 200% stoploss version at $0.9 credit. There's alot of data to go through, to imagine we have every minute entry for the 2-3 years.

For this backtest, I'll be using Rodrigo's data set. Because I'm lazy and didn't run the latest few months. Since he have those recent OO tradelogs csv, so I just took from him.

Within the OO trade logs, we already have the gap data. On top of that, we also need the VIX data which is also provided by Rodrigo but it can be found on yahoo finance.

So with the per minute tradelogs, gap data and vix data. We need to basically 'filter' these data so that we get the results of these VIX and Gap scenarios. To process this, I'm doing it using Python on Jupytor notebook with the help of chatGPT.

So in this test, I'm using data from Jan 2021 - 19 Apr 2023 because that's the data available for now.

VIX and Gap distribution

First thing I want to find out is an even distribution of trades for each VIX and Gap category. Meaning I want to determine what vix range and gap range to use.

For VIX, I load in the VIX csv into python and try a few vix range.

These are the code snippets in python jupytor notebook, they are not full as jupytor allows running the code part by part which makes it very good for such data processing. I'm just putting some of them here to show how powerful they are for such data analytics purpose.

So I want to keep it in 3 bins, <20 / 20-25 / >25. I also merged these VIX data into the OO tradelogs data I already loaded previously into pandas dataframe (df).

Then I charted it out. So I tested several different ranges until I get to this <20 / 20-25 / >25. What I want to see is that each bin has a more equal number of trades so that the category has even weight distribution.

Then I do the same for Gap.

Since the gap info is within the OO trade logs, I just need to preprocess them and tag a category as a new column.

The eventual bin for gaps used is less than -0.3%, within -0.3% to 0.3%, more than 0.3%. In layman terms, it's basically gap down 0.3%, within 0.3% or gap up 0.3%.

Then I plot the same chart to see the distribution.

We can see both gap down and gap up has around 20-25% distribution. So I used 0.3%. Also note that 0.3% in today's context where SPX is 4000 points, it's only 12 points. So what we're really categorising is gap up/down 12 points.

Now we have the VIX and Gap bins, 3 each. We will then have a permutation of 3x3 scenarios. Before we go into that final 9 permutation matrix, I ran some other intermediate results.

This is basically the PCR for each gap categories. Simple but interesting, PCR is lower when we gap down.

Another more interesting chart - PCR over time (per minute PCR) for each gap category.

Simple take away:

  • Gap down - mid day perform badly
  • Gap up - first 2 hours perform badly

Getting some useful data points already? We're not done yet. Since I have it in python, I can easily run it for 2023 only to see near term results.

Slightly different, while some similar patterns do persist. On top of that we see gap up totally got wrecked this year.

Ok, let's add in the VIX part and made the chart green/red for better visualisation.

This is the ultimate chart of the 3x3 permutation. On each row it's the VIX category and on each column it's the gap category. This includes full 2021 to 19 April 2023 data.

Each chart is the entry time PCR over time, one example to read the chart is take a look at the middle/center chart - VIX 20-25 and Gap up 0.3%. It tells us that entries in the first 1-2 hours have average negative PCR while the rest of the day seems quite acceptable. On top left, it's the low vix <20 and no gap scenario we see healthy tall green grasses throughout the entire day.

My possible take away so far:

  • no gaps are the days the tranches perform generally better
  • gap up avoid first 2 hours and maybe (1200-1300)?
  • gap down avoid mid day (1200-1400)?

Let's also run the 2023 only data and see near term 3x3 permutation.

Interesting that we don't have any VIX > 25 and gap up scenarios this year. Generally, we do have lesser >25 VIX category which makes that row looks not as enough sample data compared to the other categories.

From this 2023 set, gap up really looks alot worse so far. And this kinda relates to a theory I came up with before starting this test. When we do gap up premarket, it also means VIX has dropped even before market started. Which means we're more likely to get nearer strikes than in higher VIX environment and this is even more significant the lower the VIX goes. With that, it also means we have lower IV, lower EM, lower theta. BUT, a very interesting BUT here if we scroll up and see the gap category results. Gap up has slightly better PCR than no gap, it's actually the gap down that's performing worse.

I believe this is due to the huge environment differences in the past 2-3 years. In 2021 we had a bullish run with mostly low VIX while in 2022 we had a bearish year and constantly stayed in higher VIX. Now in 2023, we're moving into the lower VIX environment again.

There's actually alot to interpret from all the charts and permutation above. That's why I want to write this down. But I'm also aware the amount of complexity, lack of context and technicality involved.

Some added continuation of thoughts:

  • should we tweak for gap days?
  • should we run a different strategy for different scenario?
  • should we run trending tranches on gap days?
  • is there more factors other than VIX and gap to explore? EM? put/call strike distance?

Just want to journal this down although I think it's gonna be a mess and complicated post. If you got more ideas and want to discuss further feel free to reach me in discord. This discussion is currently in David Sun's Trade Buster discord, if you're not already in you'll need to pass his test to get in. Else you can catch me separately in Speaking Greek discord.

Disclaimer - The OptionOmega links in this post are all my referral links with 50% discount. This is the full url - https://optionomega.com/register/vocsong 
⚠️
This is not any financial advice or recommendation. The content shared are for informational and educational purposes only.
💡
Do Subscribe to get more latest updates and strategies on SPX and Options. Help to share if you find it useful.