Python for Finance: Analyze Big Financial Data

(Elle) #1

The VSTOXX Data


This section collects step by step the necessary data to value the American put options on


the VSTOXX. First, let us import our libraries of choice when it comes to the gathering


and management of data:


In  [ 1 ]:  import numpy as np
import pandas as pd

VSTOXX Index Data


In Chapter 6, there is a regression example based on the VSTOXX and EURO STOXX 50


indices. There, we also use the following public source for VSTOXX daily closing data:


In  [ 2 ]:  url =   ‘http://www.stoxx.com/download/historical_values/h_vstoxx.txt’
vstoxx_index = pd.read_csv(url, index_col= 0 , header= 2 ,
parse_dates=True, dayfirst=True)
In [ 3 ]: vstoxx_index.info()
Out[3]: <class ‘pandas.core.frame.DataFrame’>
DatetimeIndex: 4010 entries, 1999-01-04 00:00:00 to 2014-09-26 00:00:00
Data columns (total 9 columns):
V2TX 4010 non-null float64
V6I1 3591 non-null float64
V6I2 4010 non-null float64
V6I3 3960 non-null float64
V6I4 4010 non-null float64
V6I5 4010 non-null float64
V6I6 3995 non-null float64
V6I7 4010 non-null float64
V6I8 3999 non-null float64
dtypes: float64(9)

For the options analysis to follow, we only need VSTOXX index data for the first quarter


of 2014. Therefore, we can delete both older and newer data contained now in the


DataFrame vstoxx_index:


In  [ 4 ]:  vstoxx_index    =   vstoxx_index[(‘2013/12/31’  <   vstoxx_index.index)
& (vstoxx_index.index < ‘2014/4/1’)]

Taking a look at the data reveals that the data set not only contains daily closing values for


the main index V2TX, but also for all subindices from V6I1 to V6I8, where the last figure


represents the maturity (1 = closest maturity, 8 = longest maturity). As pointed out before,


the main index generally is an interpolation of two subindices, in particular V6I1 and V6I2,


representing in the first case a maturity of under 30 days and in the second case of


between 30 and 60 days:


In  [ 5 ]:  np.round(vstoxx_index.tail(),    2 )
Out[5]: V2TX V6I1 V6I2 V6I3 V6I4 V6I5 V6I6 V6I7 V6I8
Date
2014-03-25 18.26 18.23 18.31 19.04 19.84 20.31 18.11 20.83 21.20
2014-03-26 17.59 17.48 17.70 18.45 19.42 20.00 20.26 20.45 20.86
2014-03-27 17.64 17.50 17.76 18.62 19.49 20.05 20.11 20.49 20.94
2014-03-28 17.03 16.68 17.29 18.33 19.30 19.83 20.14 20.38 20.82
2014-03-31 17.66 17.61 17.69 18.57 19.43 20.04 19.98 20.44 20.90

VSTOXX Futures Data


The data set we use for the futures and options data is not publicly available in this form.


It is a complete data set with daily prices for all instruments traded on the VSTOXX


volatility index provided by Eurex. The data set covers the complete first quarter of 2014:


In  [ 6 ]:  vstoxx_futures  =   pd.read_excel(‘./source/vstoxx_march_2014.xlsx’,
‘vstoxx_futures’)
Free download pdf