cate-art / ANN-Option-Pricing-

Option pricing and Delta hedging performance comparison between Black and Scholes vs Artificial Neural Network
20 stars 0 forks source link
artifical-neural-network black-scholes delta-hedging derivatives finance garch-model machine-learning pricing python r-studio

About The Project

This repository contains the code I used to implement my Master Thesis in which I compare the Black and Scholes pricing formula against an Artificial Neural Networks model for option pricing and delta hedging strategy.

Data

The datasets used in this project are:

Usage

All the necessary steps in order to run this project are described in this section.

1_Preparing_data_frames.md in this R file the databases containing the option's information are merged together in one big file, the columns containing data not useful for the project are dropped and the remaining columns are renamed. After running this file, 3 new databases will be created:

2_Compute_B&S_and_GARCH.py this python script is needed to:

3_Split_Put_and_Call_data in this R markdown the dataset created in the previous step (rawdata.csv) is loaded. Afterwards the no further needed variables are removed and the cleaning process start:

4_Compute_Call_summary_table running this script compute the table which describes the moneyness distributed regarding the maturity time of the Call option.

5_Compute_data_summary this scripts plots all the descriptive graphs of the data.

6_Compute_volatility_summary this script is used to plot all the GARCH volatility performances.

7_Train_ANN with this script the Neural Network is implemented and trained

8_Evaluate_ANN running this file the comparison ANN and BSM regarding pricing prediction is obtained and the descriptive graphs are plotted

9_Comput_pricing_results_table this file groups in a table the pricing results obtained in the previous step. Furthermore, they are grouped in different groups based on moneyness, maturity and volatility

10_Compute_Hedging in this script the hedging strategy is implemented

11_Hedging_results in this script the comparison between the hedging strategy performed with the ANN model and the BSM model is printed in a table