xie-daniel / iron-butterfly-trading-strategy

Strategy implementation and backtester for the iron butterfly options trading strategy, used on 3 months of SPX options data. Found a weak-moderate negative correlation between iron butterfly profit and VIX (an indicator for volatility in the S&P 500), as expected.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigating the effectiveness of the iron butterfly strategy on European SPX options, with respect to VIX

Tools used: Python, pandas, Jupyter notebook, matplotlib, yfinance

Strategy implementation and backtester for the iron butterfly options trading strategy, used on 3 months of SPX options data. Found a weak-moderate negative correlation between iron butterfly profit and VIX (an indicator for volatility in the S&P 500), as expected.

Presented at Cornell Quant Fund Fall '23 Symposium.

Background

The iron butterfly is an options trading strategy involving 4 simultaneous options with the same expiration date: buying one OTM (out-of-the-money) put option and one OTM call option, and selling one ATM (at-the-money) put and one ATM call. It is a limited profit, limited risk strategy, as the maximum profit is capped by the profit gained by selling the ATM options, while the maximum loss is capped by buying the OTM options. Overall, the strategy profits when the price of the underlying does not move much.

Since the iron butterfly strategy benefits from low price movement, we wanted to investigate whether it is a viable trading algorithm when used in conjunction with the VIX (Volatility Index), which measures the expected volatility of the SPX (S&P 500).

An example graph of profit vs. price of the underlying at expiration, after buying an OTM put @ 60 and an OTM call @ 80 for $1 each, and selling an ATM call/put @ 70 for $5 each:

PNG image

The strategy profits most when the underlying price stays at 70, while losses are capped at $2 if the underlying price changes significantly.

Hypothesis

When the VIX is low, the Iron Butterfly strategy will generate more profit and have a higher win ratio. When the VIX is high, losses will be capped.

Implementation

We created a backtester and an implementation of the strategy can be found in Iron_Butterfly_Investigation.ipynb. It uses a spread size of 300 and looks for the best OTM/ATM SPX puts/calls for each day from 4/3/2023 to 6/30/2023, then simulates the amount of profit generated by each iron butterfly, each day.

Results

Results, including the trades made by the algorithm, can be found in Iron_Butterfly_Data.xlsx.

Screenshot 2023-12-07 at 5 26 35 PM Screenshot 2023-12-07 at 5 26 51 PM

There is a clear increase in success rate when VIX is low (low volatility). Additionally, the maximum loss from an iron butterfly appears to be capped at around $50, which was what we wanted.

When VIX is low (< 16), we can also see a slight negative correlation between VIX and profit. Indeed, the correlation coefficient r = -0.213 (weak negative correlation) for the iron butterflies done with expiration date 8/18, and correlation coefficient r = -0.314 (weak-moderate negative correlation) for the ones with expiration date 9/15.

Limitations

Potential selection bias/confounding variables: We only had access to 3 months of SPX options data. All of the dates where there was low VIX were consecutive days in the last couple weeks of our data. It is possible that those last couple weeks just happened to be a good time to use the iron butterfly strategy, for other confounding reasons (perhaps since they were closer to the expiration date).

Not many trials: We did not try the strategy with different types of options, different spread sizes, and different timeframes.

No transaction fees: Since each iron butterfly consists of 4 options trades, there would likely be a high transaction fee in the real world.

About

Strategy implementation and backtester for the iron butterfly options trading strategy, used on 3 months of SPX options data. Found a weak-moderate negative correlation between iron butterfly profit and VIX (an indicator for volatility in the S&P 500), as expected.


Languages

Language:Jupyter Notebook 100.0%