Predicting IXIC Stock Price Index Movement Using VIX Futures Term-Structure and Random Decision Forests Method

The VIX index is a powerful tool used by institutional traders to gauge market ‘fear’ and ‘greed’. Since VIX futures provide a measure of the implied volatility of 30-day at the money of the S&P 500 index options, traders often use long VIX futures as a hedge for their positions, to speculate in different financial instruments and effectively deal with risk (Traub, Ferreira, McArdle, & Antognelli, 2000). This research suggests a new model to predict NASDAQ 100 (IXIC) index direction using the VIX futures term structure, which generally negatively correlates with asset returns. The VIX futures term structure follows a Markov Process, meaning that each state or value depends probabilistically on the previous state or value. Computationally, two strategies based on Ensemble Machine Learning Methods were used to predict market directions using VIX Futures term structure historical data including current VIX value, and the Convergence-divergence between VIX futures and popular index futures contracts mainly S&P 500 and NASDAQ 100. Performance reports on test datasets and back-testing evaluate the efficiency of our models and how does their predictability vary among Contango versus Backwardation. Our key finding suggests that the model trained using combined information about VIX futures term structure and historical VIX data performed better than the model trained using only information about VIX futures term structure in terms of cumulative returns and the number of trading signals generated.

Table of Content

1. Introduction

“The Chicago Board Options Exchange (CBOE) created the Volatility Index (VIX) in 1993 to measure the implied volatility of 30-day at the money S&P 100 index options”. Because S&P500 index options are more widely traded, the new VIX measure technique was then introduced in 2003 (J. & Thomas W. Miller, 2005). Options with bid quotations above zero that are more than one standard deviation from the S&P 500 index’s forward value are included in the calculation of the VIX.

With just five trading days left on the initial contract, option prices from contracts two and three are utilized to create an interpolated VIX index based on their mid-point bid-ask spreads. The VIX has the added advantage of compatibility with the pricing of volatility swaps. In addition, though the spot VIX cannot be traded, it is a helpful predictor of shifting demand for low-risk S&P 500 index call options and put options. This is of particular importance since traders use S&P 500 index call and put to hedge long stock portfolios. To maintain a 30-day interpolated maturity, a basket of options might theoretically duplicate the VIX. However, doing so would be prohibitively costly due to the massive number of options to be purchased and exchanged continuously.

Some traders/researchers have found that adding VIX derivatives to their portfolios reduces the overall portfolio volatility. This is primarily due to the negative correlation between the VIX and the S&P500. See Kensinger, (2012) and the references therein. VIX Futures are “a bet against the future level of implied volatility” and thus contain information on persived or future implied volatility (Bossu, (2014)).

Plotting the prices of such VIX Futures prices against their expiration dates produces what is known as the VIX Futures Term Structure or futures curve for short. If a futures curve trends upward from left to right, it is called Contango (the market is in Contango). For the VIX, this occurs when long-term VIX futures are more valuable than short-term VIX futures, as shown in the following graph. However, when the opposite occurs, it is called Backwardation (Simon & Campasano, 2014).

Under conditions of contango it is understood that the market expects to see the VIX index increase in value while on the other hand, Backwardation is the expectation that the VIX index will fall. In the long-term, Contango actually occurs most of the time, due to the asymmetrical and mean-reverting character of the VIX and volatility in general. Thus, in addition to the VIX and the VIX Futures term structure theoretically the Contango/Backwardation cycle may contain more information by which to predict market movements.

In this research, a new model to predict S&P 500 index (returns) direction is suggested using the VIX index, VIX Futures term structure, S&P500 and NASDAQ100 indices with the aid of ensemble machine supervised learning approaches for classification called Random Forests. Research into VIX futures term structure shows promise as a source of market signaling data (Feldman et al. 2018). As a result, we intend on adding to the body of knowledge on trading strategies based on VIX futures by examining the future stock movement timing abilities of the VIX futures term structure.

The rest of the paper is divided as follows: in Section 2. we provide a literature review followed by a discussion on the data used in this study in Section 3. Section 4 describes our methodology, while Section 5 documents our results and finally our conclusion is in Section 6.

2. Literature Review and Research Background

2.1 The VIX Term Structure

The VIX is computed in a model-free framework as (CBOE, 2022):

\sigma^{2}=\frac{2}{T} \sum_{i} \frac{\Delta K_{i}}{K_{i}^{2}} e^{R T} Q\left(K_{i}\right)-\frac{1}{T}\left[\frac{F}{K_{0}}-1\right]^{2}

Where:

Figure 1. Contango of VX futures (from April 2022 to October 2022) and Backwardation (from October 2022 to November 2022)[1] [1] Source: VixCentral.com

As noted before, these instruments have the potential of carrying significant information for trading. Researchers like Fassas (2016) have carried out empirical research on the relationship between the futures term structure and S&P500 returns. They found that there was a strong statistically significant relationship between changes in the VIX Futures level and the S&P500 returns. They used econometric methods to arrive to their conclusion. Moreover, Fassas and Hourvouliades (2019) specifically studied the market timing properties of the same and confirmed long held conjectures by market participants. They conclude that the VIX Futures Term structure can be used as a “proxy of market expectations” as well as a “stock market timing” instrument.

Quantifying the state of contango and backwardation has been approached differently in literature. Avellaneda et. al (2021) studied VIX Futures trading and they emphasized that use of the term structure in their study. Due to the tendency of the Term structure to revert quickly from backwardation to contango, they showed that one could profitably trade VIX Futures based on its structure. They estimated the contango level as a linear interpolation of VIX Futures. On the other hand Luo and Zhang (2012) depart from the model free approach and propose a two-factor framework with stochastic volatility to model the term structure. Nevertheless, we will have a linear interpolation to depict the contango/backwardation level.

2.2. Machine Learning Ensemble Methods for Optimal Predictive Models

Ensemble methods include a combination of multiple learning algorithms to produce stronger predictions than it could be with each algorithm individually. Common types of ensembles might include: Bayes optimal classifier, Bucket of models, Bagging, Bayesian model averaging, Boosting, Bayesian model combination, and stacking (Bhargavi, 2022).

Figure 2. Diagram of a random decision forest

In this paper, the focus is on a bootstrap aggregating (or simply bagging) application called ‘Random Forests’ as it offers relatively the most optimal predictive capabilities compared to the other Ensemble Models. Random forests consist of a set of decisison trees in an ensemble designed to provide a more accurate classification compared to an individual decision tree (Smith, 2010). Scikit-learn (a Python library offered by Keras framework) provides packages for bagging methods like random forests (scikit-learn.org, 2022). Refer to Figure 1. for an illustration of the method.

VIX, S&P500 and NASDAQ100 futures historical data are used for feature engineering, training and testing the models. Random forests models would be able to predict future market direction and plot Buy/Sell signals on a real-time price chart of S&P500.

2.3. VIX Futures Trading signals

Researchers have studied the value of the VIX Futures Term Structure for VIX Futures trading. For instance, Fassas (2016), Fassas and Hourvouliades (2019), Jabłecki et. al (2014) among many others have obtained statistically significant evidence of the value of the term structure for trading VIX Futures. However, to the best of our knowledge, there has not been a study on the impact of the term structure on trading stock indices.

3. Data Preparation and EDA

Historical data for VIX, VIX futures, and S&P500 (SPX) has been acquired from the data source2 cited below, within the data frame between 01/03/2016 and 08/04/2022.  NASDAQ index (IXIC) historical data within the same data frame was obtained from yahoo finance using yfinance python package.

The collected data were used for feature engineering, training, performance measurement, and back-testing.
To calculate the current level of contango we use the following formula:

    \[$\mathrm{Ct}_{\mathrm{M}_{\mathrm{i}}, \mathrm{M}_{i+1}}=\frac{\left(\mathrm{FVIX}_{\mathrm{M}_{\mathrm{i}+1}}-\mathrm{FVIX}_{\mathrm{M}_{\mathrm{i}}}\right) \cdot 100}{\text { FVIX }_{\mathrm{M}_{\mathrm{i}}}}$\]

Where:

    \[$ \mathrm{Ct}_{\mathrm{M}_{\mathrm{j}}, \mathrm{M}_{\mathrm{i}+1}}$ is percent. Contango between month $\mathrm{M}_{\mathrm{i}+1}$ and month $\mathrm{M}_{\mathrm{i}}$ VIX Futures. \\ $ \mathrm{FVIX}_{\mathrm{M}_{\mathrm{i}+1}}$ and FVIX $\mathrm{M}_{\mathrm{i}}$ are VIX future values at month $\mathrm{M}_{\mathrm{i}+1}$ and $\mathrm{M}_{\mathrm{i}}$ respectively.\]

Additionally, the moving average convergence/divergence (MACD) for both SPX and IXIC was computed. This tells us about the convergence and divergence of the two moving averages. Convergence occurs when the moving averages move towards each other. Divergence occurs when the moving averages move away from each other. The plots of the MACD show a significant co-movement in the SPX and IXIC data. Also, the VIX and VIX futures data seem to share significant information with the SPX and IXIC data as expected.

Figure 3. Timeseries plots of the data

4. Methodology

4.1 Feature Engineering

The computed IXIC entry positions on each point is based on the next l historical prices, determined risk-reward ratio, and our profit target. Entry positions (signals) can have one of the following values: -1 (Sell), 1 (Buy), 0 (No Trade). These values will be used as target values/dependent variable to train our model. To compute signal values from the next l prices we use the following formula

To compute signal values from the next l prices we use the following formula:

    \[E_{t, 1}=\operatorname{sgn}\left(\log \left(\left|\frac{\frac{\max t \leq i \leq t+1 p_{i}-p_{t}}{p_{t}}}{\frac{\min _{t \leq i \leq t+l} p_{i}-p_{t}}{p_{t}}}\right|\right)\right)\]

Where

    \[$\mathrm{E}_{\mathrm{t}, 1}$ is the trading signal at $t$ computed using the next $l$ values.\]

sgn is defined as follows:

    \[\operatorname{sgn}: \mathbb{R} \rightarrow\{-1,0,1\}\]

    \[x \mapsto \operatorname{sgn}(x)=\left\{\begin{array}{cc}-1 & \text { if } x \leq \mathrm{T} \text { and } \frac{\max _{\mathrm{t} \leq i \leq t+l} p_{i}-p_{t}}{p_{t}}<\mathrm{s} \\ 1 & \text { if } x \geq \mathrm{T} \text { and } \frac{\min _{t \leq i \leq t+l} p_{i}-p_{t}}{p_{t}}>-\mathrm{s} \\0 & \text { Otherwise }\end{array}\right.\]

    \[$ \max _{t \leq i \leq t+l} p_{i}:$ the maximum price value of the vector containing the next $l$ historical prices including the current price. \\ $ \min _{t \leq i \leq t+l} p_{i}:$ the minimum price value of the vector containing the next $l$ historical prices including the current price. \\ $ T$ : is the Log of the targeted returns (Max/Min) ratio. \\ $ p_{t}$ : is the price at time $\mathrm{t}$ (the current price). \\ $ \mathrm{s}$ is the rolling Log returns standard deviation: $s=\sqrt{\frac{1}{l-t} \sum_{i=t}^{l}\left(x_{i}-\bar{x}\right)^{2}}$\]

In order to incorporate the interaction with the VIX, the mean VIX level for the buy (Et,l=1) and for the sell (Et,l=-1) signals and obtain an updated signal is calculated.

4.2. Implementation of the Random Forrest Models

Using scikit-learn, two random forest models were trained on 80% of randomly shuffled data. Accuracy reports were estimated using the remaining 20% of the dataset.

For Model 1 (strategy 1) Features (X) are the following: ‘VIX’: VIX Spot at day d (current value) – ‘contango_m1’: % Contango at Month 1 from day d – ‘contango_m2’: % Contango at Month 2 from day d – ‘contango_m3’: % Contango at Month 3 from day d – ‘spx_macd’: SPX MACD value at day d – ‘spx_signal’: SPX MACD Signal value at day d – ‘ixic_macd’: IXIC MACD value at day d – ‘ixic_signal’: IXIC MACD Signal value at day d .

We applied some technical constraints when generating signals: when the value of VIX is below 17% (calculated threshold), it is a LONG signal. However, when the value of VIX is above 17% (calculated threshold) it is a SHORT signal.

For model 2 (strategy 2) more historical information about VIX has been provided. Features (X) are the following – ‘vix_macd’: VIX Spot MACD at day d (current value) – ‘vix_signal’: VIX MACD Signal value at day d – ‘contango_m1’: % Contango at Month 1 from day d – ‘contango_m2’: % Contango at Month 2 from day d – ‘contango_m3’: % Contango at Month 3 from day d – ‘spx_macd’: SPX MACD value at day d – ‘spx_signal’: SPX MACD Signal value at day d – ‘ixic_macd’: IXIC MACD value at day d – ‘ixic_signal’: IXIC MACD Signal value at day d. Target values or Labels (Signals) (y): could be either -1(short) 1(long) or 0(no trade).

K-Fold cross validation method using KFold() scikit-learn class with a fixed k value of 10 was used to estimate the prediction skill of our RandomForrest Models.
Model accuracy, cross validation score, precision in predicting trade signals on the test data set are shown in the table below.

Table 1. In sample performance metrics

An investigation of each feature importance was performed using the Gini coefficient which is a measure of how each variable contributes to the homogeneity of the nodes and leaves in the resulting random forest. The higher the value of mean decrease accuracy or mean decrease Gini score, the higher the importance of the variable in the model. Thus, this investigation revealed that the VIX had a significantly higher importance in the model for Strategy 1 as shown in the following plot:

Figure 3. Plot of Strategy 1 Gini coefficients


It is primarily due to this observation that we considered incorporating more information from the VIX in strategy 2. As shown below, the VIX related information streams have a great bearing on the performance of the model as shown below:

Figure 4. Plot of Strategy 2 Gini coefficients

5. Results

5.1 Model Performance

Our model predicted the signals as shown in the following figure:

IXIC trading signals generated by model 1 and model 2 respectively are plotted below:

Figure 5. Plot of Strategy 1 trading signals
Figure 6. Plot of Strategy 2 trading signals

These plots alone cannot evaluate the model performance. Confusion matrix plot for each model has been generated in order to ascertain how many of a classifier’s predictions were correct, and when incorrect, where the classifier got confused is computed. Clearly, according to the figure below, our Strategy 1 model struggles in predicting short signals.

Figure 7. Strategy 1 Confusion Matrix

Although model 2 provided better predictions for both short and long signals, it didn’t perform well in the No-trade scenario as seen in the figure below:

Figure 8. Strategy 2 Confusion Matrix

5.2 Backtesting

For more quantitative analysis, we employed the python backtrader package to backtest our model. Our model had a closing balance of 303297.66 (Strategy 1) and994474.22 (Strategy 2) from an initial cash balance of $100000 over the period 2016-05-09 to 2022-01-04 is observed. Additionally, performance statistics using pyfolio (a Python library for performance and risk analysis of financial portfolios developed by Quantopian Inc.) are outlined in the table below:

Table 2. Backtesting results
Figure 9. Strategy 1 Backtesting using Backtrader (Cumulative returns vs Drawdowns)
Figure 10. Strategy 2 Backtesting using Backtrader (Cumulative returns vs Drawdowns)

5.3 Contango versus Backwardation

Accuracy scores were computed using back-testing datasets.

Table 3. Contango/Backwardation performance of strategies

Table 3 shows that model 1 is slightly more accurate than model 2, however model 2 generates more trading signals than model 1 with 4.4 times more cumulative returns and 3 times closing value than model 1.
Both model 1 and model 2 have better accuracy in Contango (M1) compared to Backwardation (M1).

6. Conclusion

Two different models have been developed to predict future IXIC (NASDAQ composite index) move using VIX futures terms structure, SPX (S&P500 index), and IXIC historical data. The models performed very well both in Contango and Backwardation with a slight difference in accuracy. Both models provided a better accuracy (more than 94.8%) in Contango compared to Backwardation. Model 2 performed better in terms of cumulative returns and the number of trading signals generated.

Research limitations might include time and budget that preclude the prospect of collecting, cleaning, filtering data, feature engineering, and building the models.

In addition, a major limitation of Random Forests models consists in the fact that a huge number of trees might cause the algorithm to perform very slowly and inefficiently when making predictions in real-time. Generally, such algorithms tend to be fairly fast to train, but relatively slow to generate forecasts. Some papers consider such models as black boxes since it is difficult to clearly see what happens inside.

References

Avellaneda, M., Li, T. N., Papanicolaou, A., & Wang, G. (2021). Trading signals in VIX futures. Applied Mathematical Finance, 28(3), 275-298.

Bhargavi, K. (2022). Zonotic Diseases Detection Using Ensemble Machine Learning Algorithms. Fundamentals and Methods of Machine and Deep Learning: Algorithms, Tools and Applications, 17-32.

Bossu, S. (2014). Advanced equity derivatives: Volatility and correlation. John Wiley & Sons, Incorporated.

cboe. (2022). Volatility Index (VIX®) Futures. Retrieved from cboe.com: https://www.cboe.com/tradable_products/vix/vix_futures/

Fassas, A. (2016). The relationship between VIX futures term structure and S&P500 returns. Available at SSRN 2841384

Fassas, A. P., & Hourvouliades, N. (2019). VIX futures as a market timing indicator. Journal of Risk and Financial Management, 12(3), 113.

Heston, S. L. (2000).

J., C. C., & Thomas W. Miller, J. (2005). The forecast quality of CBOE implied volatility indexes. Journal of Futures Markets: Futures, Options, and Other Derivative Products, 339-373.

Jabłecki, J., Kokoszczyński, R., Sakowski, P., Ślepaczuk, R., & Wójcik, P. (2014). Does historical VIX term structure contain valuable information for predicting VIX futures?. Dynamic Econometric Models, 14, 5-28.

Kensinger, J. W. (Ed.). (2012). Research in finance. Emerald Publishing Limited.

Luo, X., & Zhang, J. E. (2012). The term structure of VIX. Journal of Futures Markets, 32(12), 1092-1123.

scikit-learn.org. (2022). scikit-learn. Retrieved from scikit-learn.org: https://scikit-learn.org/

Simon, D. P., & Campasano, J. (2014). The VIXPP futures basis: Evidence and trading strategies. The Journal of Derivatives, 54-69.

Smith, A. (2010). Image segmentation scale parameter optimization and land cover classification using the Random Forest algorithm. Journal of Spatial Science, 69-79.

Traub, H. D., Ferreira, L., McArdle, M., & Antognelli, M. (2000). Fear and greed in global asset allocation. The Journal of Investing, 27-31.

image_pdfExport to PDFimage_print

Comments

So empty here ... leave a comment!

Leave a Reply

Sidebar