Deep Neural Networks Option Pricing

Machine learning and in particular deep neural networks have been all the buzz in recent years. They have become popular topics in all industries ranging from facial recognition to predicting equity returns. I’m going to present two little projects that I’ve recently worked on. The first being using deep neural networks in derivatives pricing or in the case that I used it , finding implied volatilities. This allows someone to skip over the steps of either Black–Scholes or finite differences depending on the asset and just focus on current market data. Due to my limited access to data it may seen not fully complete as it serves as a proof of concept. The second experiment was to prove that technical analysis has limited if any ability to predict asset returns. Technical analysis and technical trading is using a series of signals on a chart to indicate if that equity is a “buy” or “sell” and is what most people think of when trading comes to mind. Unfortunately for technical day traders this is a cargo cult (pseudoscience).

Deep Neural Network Option Pricing

Hypothesis

By using current market data and a deep neural network consisting of input layer , output layer, and several hidden layers, it is possible to accurately calculate the implied volatility of American options. Methods ( skip this if you don’t want to read the details of the machine learning model or activation functions I picked)

Methods ( skip this if you don’t want to read the details of the machine learning model or activation functions I picked)

Received SPY American call option chain for every expiration and every available strike. Solved for implied volatility using gjr-garch underlying volatility and the mid of the contract using the reverse finite difference method. In NAs appeared they were cut out. I then did a 80/20 test train split. The dependent variable (Y) selected was the implied vol. The independent variables (X) were Strike, Bid, Ask, Mid, Volume, Open Interest, and maturity(days left divided by 272). Using the Keras package I created a deep neural network consisting of an input layer with 400 nodes and an activation function of Rectified Linear Unit there was then 4 hidden layers each with 400 nodes and all using the same Relu activation function. The output layer was 1 node since there is only one output variable and it had the activation function of tanh. The model uses the mean squared error as the loss function and optimizes with RMSprop. I ran the model with 100 epochs and batch sizes of 10 with a validation split of 20%. Mean average error was also displayed.  

Results

The training set had a MSE of 0.23% and a MAE of 0.0159. On the test set the MSE was 6.79% and a MAE of 0.1272 meaning there is evidence of over-fitting the training set. 

Further reading/research

With more data I’d like to test this again with bid ask volume and some other variables ranging from deltas to historical IV. The paper below served as the basis and I would like to replicate that paper some more.

http://cs230.stanford.edu/projects_fall_2019/reports/26260984.pdf

Technical analysis DNN

Hypothesis

Technical analysis is unable to predict returns  

Methods

Taking the daily returns of SPY and encoding positive return days as a 1 and negative return days as a 0 these serve as the dependent variable used in this classification problem. Then producing 3 signals all lagged by one day so it is the previous close signal. Signal 1 is the 5 day moving average dividend by the 20 day if positive this is suppose to indicate high momentum. Similarly the other two signals are the 5/ 50 day and the 20/200 day moving averages. The neural network is created with an input layer of 512 nodes and a relu activation function. The two hidden layers are 128 nodes and 64 nodes with the same relu activation function. The output layer is 1 node and uses a sigmoid activation function. The model uses a binary cross entropy as a loss function and RMSprop as an optimizer. The model is ran 15 times with a batch size of 5.

Correlation matrix

As you can see from the correlation matrix there is no significant correlation between the signals and a positive next day return.

Results 

The model had an accuracy as 54.51% on the training set and a similar result of 56.11% on the the testing data set. This shows that these simple technical trading skills have little to predict actual returns of the asset. Further research is to be done on more advanced signals that are common.

NKLA Opinion Article

*DISCLAIMER: THIS IS THE OPINION OF THE WRITER AND NOT A RECOMMENDATION OR OFFER OF SERVICE OF ANY KIND TO THE READER. IT SERVES AS AN EDUCATIONAL TOOL ONLY*

With NKLA only having trading data since 6/3 , data is what I would call limited. Needless to say the last several days have been a textbook retail investor time series. A massive spike on a 0 revenue company on speculative news. I’m going to stay away from the fundamentals , if it has any, and try to speak from the options data I have available in order to explain my thoughts. 

For starters underlying volatility calculated from the gjr-garch model is 926.82% annualized. To give you a comparison Tesla’s garch volatility is 77.94%. For those of you who have never taken a derivatives course or don’t know the math on option pricing, higher underlying volatility equals greater price of the option. 

Looking at the contract specific side the $19.50 6-26 Put has an implied volatility of 309%. That’s the implied volatility retrieved from the finite-difference option pricing in reverse or the volatility that will give the current price of the option back. Some of these contracts are so overpriced on a volatility basis that it is impossible to calculate the implied volatility using traditional methods, meaning that no implied volatility will give back the current market price of the contracts, you can notice the holes in the term-structure graph. Similarly if you’ve been following my other term-structure graphs you have noticed the blue line or “actual implied” by using the at-the-money contract price this allows the reader to see where volatility should be. NKLA doesn’t have that blue-line because again it’s unable to be calculated using those traditional methods.

Normally my opinion would be to short volatility doesn’t matter the contract but there is so little data available I am unable to calculate where volatility should be at this given time. The calculated delta for the $19.50 put is -0.0357 or roughly 3.57 shares to be hedged. The investor would have to sell the $19.50 put and then go short 4 shares. But again if the investor does not understand option pricing or the greeks I would stay away to avoid getting caught off guard.

IV Viewer + Term Structure NKLA 2020-06-11

Description

Actual Implied is the calculated At-the-money implied volatility given the various strike prices. Call and put implied gives the current market implied volatility for each individual contract using the mid price.

Opinion

All of the contracts are overpriced on a per volatility basis. The term-structure  implied vol is not even calculable by tradition methods. This is certainly the retail investor buzz. I would say go short vol.

*DISCLAIMER: THIS IS THE OPINION OF THE WRITER AND NOT A RECOMMENDATION OR OFFER OF SERVICE OF ANY KIND TO THE READER. IT SERVES AS AN EDUCATIONAL TOOL ONLY*

Purpose

Allows the investor to see what option contracts are missed priced due to implied volatility. Knowing this, the investor can make a delta neutral trade that is either Long or Short volatility. As the volatility begins to correct itself, regardless of underlying movement, the trade will become profitable as long as the overall position remains delta neutral.

IV Viewer + Term Structure AMD 2020-06-11

Description

Actual Implied is the calculated At-the-money implied volatility given the various strike prices. Call and put implied gives the current market implied volatility for each individual contract using the mid price.

*DISCLAIMER: THIS IS THE OPINION OF THE WRITER AND NOT A RECOMMENDATION OR OFFER OF SERVICE OF ANY KIND TO THE READER. IT SERVES AS AN EDUCATIONAL TOOL ONLY*

Purpose

Allows the investor to see what option contracts are missed priced due to implied volatility. Knowing this, the investor can make a delta neutral trade that is either Long or Short volatility. As the volatility begins to correct itself, regardless of underlying movement, the trade will become profitable as long as the overall position remains delta neutral.

IV Viewer + Term Structure Apple 2020-06-11

Description

Actual Implied is the calculated At-the-money implied volatility given the various strike prices. Call and put implied gives the current market implied volatility for each individual contract using the mid price.

*DISCLAIMER: THIS IS THE OPINION OF THE WRITER AND NOT A RECOMMENDATION OR OFFER OF SERVICE OF ANY KIND TO THE READER. IT SERVES AS AN EDUCATIONAL TOOL ONLY*

Purpose

Allows the investor to see what option contracts are missed priced due to implied volatility. Knowing this, the investor can make a delta neutral trade that is either Long or Short volatility. As the volatility begins to correct itself, regardless of underlying movement, the trade will become profitable as long as the overall position remains delta neutral.

IV Viewer + Term Structure TESLA 2020-06-11

Description

Actual Implied is the calculated At-the-money implied volatility given the various strike prices. Call and put implied gives the current market implied volatility for each individual contract using the mid price.

Opinion as of 5-26-2020

Tesla is one of the most speculative securities in today’s market. Analyst’s recommendations on Bloomberg have ranged $1 to $1000 at any one given time. This is even more visible inside the options chain. As you can see from the volatility graph the strikes further away from the market price are increasingly mispriced. Meaning that the market priced implied volatility for specific contracts is different from the actual implied volatility for that given strike. In an example trade the 990 6-19 Call who’s implied volatility is 59.3% , a 17.9% difference from the actual implied volatility. To go short on volatility and remain delta neutral , unaffected by underlying moves, you would sell the 990 call and buy 15 shares of Tesla stock. Since Vega is currently trading at 0.49 the intrinsic value of the call option should be $1.28 even though it is trading at $10.05. On a per Vega basis one can expect a $49 profit/loss per 1% movement of volatility.

*DISCLAIMER: THIS IS THE OPINION OF THE WRITER AND NOT A RECOMMENDATION OR OFFER OF SERVICE OF ANY KIND TO THE READER. IT SERVES AS AN EDUCATIONAL TOOL ONLY*

Purpose

Allows the investor to see what option contracts are missed priced due to implied volatility. Knowing this, the investor can make a delta neutral trade that is either Long or Short volatility. As the volatility begins to correct itself, regardless of underlying movement, the trade will become profitable as long as the overall position remains delta neutral.

Garch Volatility 2020-05-26

plot of chunk pressure

30 day forecast unannualized implied volatility

Yesterday VIX
28.16

Yesterday Realized Vol
39.2795650464865

Yesterday Calculated
19.847003

Today’s predicted
19.799402

Tomorrow’s predicted
19.7528232

Delta from yesterday’s predicted and VIX
8.312997

Delta from yesterday’s predicted and Realized Vol
19.432562058343

Percent Difference from yesterday’s predicted and VIX
29.521%

Percent Difference from yesterday’s predicted and Realized Vol
49.472%

Based off of 2020-05-26

IV Viewer + Term Structure SPY 2020-05-23

Description

Actual Implied is the calculated At-the-money implied volatility given the various strike prices. Call and put implied gives the current market implied volatility for each individual contract.

Purpose

Allows the investor to see what option contracts are missed priced due to implied volatility. Knowing this, the investor can make a delta neutral trade that is either Long or Short volatility. As the volatility begins to correct itself, regardless of underlying movement, the trade will become profitable as long as the overall position remains delta neutral.

Garch Volatility 2020-05-23

plot of chunk pressure

30 day forecast unannualized implied volatility

Yesterday VIX
28.16

Yesterday Realized Vol
39.2795650464865

Yesterday Calculated
19.847003

Today’s predicted
19.799402

Tomorrow’s predicted
19.7528232

Delta from yesterday’s predicted and VIX
8.312997

Delta from yesterday’s predicted and Realized Vol
19.432562058343

Percent Difference from yesterday’s predicted and VIX
29.521%

Percent Difference from yesterday’s predicted and Realized Vol
49.472%

Based off of 2020-05-21