Skip to content

Latest commit

 

History

History
145 lines (105 loc) · 7.76 KB

README.md

File metadata and controls

145 lines (105 loc) · 7.76 KB

Volatiltiy Calculations

Table of Contents


Introduction

This project was done as part of the quantitative portfolio management course at the University of St. Gallen. Our main goal was it to get a better understanding of volatility as well as its use cases.
The Literature we used was:

Hilpsch (2017): Listed Volatility and Variance Derivatives

Gruenbichler and Longstaff (1996): Valuing Futures and Options on Volatility, Journal of Banking & Finance

Bloomberg L.P. (2020) option prices: SX5E, V2X, MXWO / index prices: SX5E, V2X, MXWO, FVS / interst rates: US0003M, US0001M, EUR003M, EUR001M . Retrieved Mar. 17, 2020 from Bloomberg database


Volatility Index Calculation (/python)

1. General Information

All functions needed to compute the volatility index can be imported from the VIndex package. The other two classes (plotter_class.py and importer_class.py) are just used to get the data ready and plot it in a nice manner and will therefore not be discussed further.

From the VIndex package you can import the volatiltiy class which is used to do all necessary calcualtions.
To use this class it needs to be initialized with option and interest data. The requirements for this data are as follows:

VSTOXXCalc = volatility_index(options, interest)

options [pd.Dataframe]: "call_price" [float], "call_volume" [float], "date" [pd.Timestamp] , "maturity" [float], "strike" [float], "put_price" [float], "put_volume" [float]

interest [pd.Dataframe]: "interest_rate" [float], "date" [pd.Timestamp]

The user can execute the following functions:

VSTOXXCalc.calculate_index(min_price = 0.5, min_volume = 0, min_num_options = 6, return_data = False)

This function calculates the 30 day volatility index. The following parameter can be handed over:

min_price [float]: minimum price a option need to have to be considered.
min_volume [float]: Parameter which can be set >0 if only liquid options should be taken into account.
min_num_options [float]: minimum number of options needed for the index to be calculated. If at a given date less than min_num_options are available, NA is returned for the index.

The return contains the daily volatiltiy index in the column "VIndex". The data provided in the other columns is described below:

return [pd.Dataframe]: ["V_1" [float], "M_1" [pd.Timestamp], "NO_1" [float], "V_2" [float], "M_2" [pd.Timestamp], "NO_2" [float], "N_1" [float], "N_2" [float], "T_1" [float], "T_2" [float],"VIndex" [float]]

V_{} [float]: Value of subindex.
M_{} [pd.Timestamp]: Maturity date of the options the subindex is based on.
NO_{} [float]: Number of options available to calculate this subindex.
N_{} [pd.Timedelta]: time until the options the subindex is based on expire.
VIndex [float]: Final volatility Index for the day

VSTOXXCalc.compare_index(index2)

This function compares the vindex stored in the class to another index provided and matches the type dimensions.The following parameter need to be handed over:

index2 [pd.Dataframe]: Dataframe containing the data of the second index (columns= "date" [pd.Timestamp], "Index" [float])

return [pd.Dataframe]: ["constructed" [float], "real" [float], "diff" [float]]

constructed [float]: Volatility index contructed inside the class
real [float]: Index provided in the function for the matching timestamps
diff [float]: Difference between the two indices in percent

VSTOXXCalc.save_index(filepath, indexname)

This function saves the index created in the class to .xslx. The following parameter need to be handed over:

filepath [string]: file path were the index.xlsx should be stored. A trailing "" is required.
indexname [string]: filename of the excel file

2. Calculation of the VSTOXX Index

Note: Due to copyright restrictions no data can be provided. However in the data.xlsm file (/input/data.xlsm) the general structure of the data can be seen. Furthermore this file can be used to download the data at a Bloomberg terminal.

Calculation of the 1 month VSTOXX and comparision with the real 1 month VSTOXX to ensure correct implementation.
related files: /current_vstoxx.py
By running this the following graphics will be created: Options Available per Day EUROSTOXX50 constructed VSTOXX real VSTOXX Difference between constructed and real VSTOXX

3. Creation of a MSCI world volatility index

Note: Due to copyright restrictions no data can be provided. However in the data.xlsm file (/input/data.xlsm) the general structure of the data can be seen. Furthermore this file can be used to download the data at a Bloomberg terminal.

Creation of a new volatility index based on the MSCI World index.
related files: /msci_world.py
By running this the following graphics will be created: Options Available per Day MSCI World constructed Volatility Index on the MSCI World constructed Volatility Index on the MSCI World


Volatility Options Model (/R)

Note: Due to copyright restrictions no data can be provided. However in the data.xlsm file (/input/data.xlsm) the general structure of the data can be seen. Furthermore this file can be used to download the data at a Bloomberg terminal.

Daily calibration of Gruenbichler and Longstaff model (1996) for volatility derivatives based on historical option and future data.
Visual comparision of observed and model prices for different estimation dates and maturities.
Simulate Cox-Ingersoll-Ross process for pricing derivatives via monte carlo simulation.
In progress: replication of realized variance with log contract.
related files: /QPM_Volatility_Options_GLModel_and_CalibrationGLModel.Rmd
related files: /functions.R


Volatility Trading Strategy (/R)

Note: Due to copyright restrictions no data can be provided. However in the data.xlsm file (/input/data.xlsm) the general structure of the data can be seen. Furthermore this file can be used to download the data at a Bloomberg terminal.

Implementation and analysis of constant proportion trading strategy of EUROSTOXX and VSTOXX for 10years including rebalancing and transaction cost.
Descriptive analysis of EUROSTOXX, VSTOXX and realized volatility.
related files: /QPM_Trading_Strategy_Descriptive_Plots.Rmd
related files: /functions.R


Team


Support

If you have any questions please reach out to us via mail.


License

Copyright 2020 © DrWatson42 & Faruman