Thursday, June 23, 2011

Option Volatility Part 2

Today we will discuss the methodology behind a Python program to calculate historic volatility, in order to generate a decision on whether to buy or short a particular option.

We need to keep a few things in mind before we move on. REMEMBER this: We want to buy when implied volatility is low and sell when implied volatility is high. Moreover, we want to buy when implied volatility is less than historical volatility and sell when implied volatility is greater than historical volatility.

Lets go over the inputs for our model:
  1. Historical Stock Prices (a text file full of closing prices, similar to the Pair Trading Program)
  2. Current Stock Price
  3. Strike Price
  4. Days to Expiration
  5. Call or Put
  6. Listed Option Premium
  7. Listed Implied Volatility
  8. Delta Value
  9. Vega Value
What we would like as outputs:
  1. Historical/Statistical Volatility (annualized)
  2. Indicator as to whether HV/SV is greater than, less than, or equal to IV
  3. One Standard Deviation Range of Stock Prices based on IV (at expiration with standard normal curve)
  4. Volatility change needed to hit upper and lower bound of Standard Dev. Range based on Vega
  5. Corresponding new THEORETICAL option premium price after the hitting upper or lower bound of the range
  6. Profit Per Contract based on theoretical new option premium
Methods for calculating outputs:
  1. To calculate HV/SV, we will read in the last 30 data points for closing prices of a given security, we will make a list of the day to day price changes, then we will calculate the standard deviation of the list and annualize it by multiplying by the square root of 254.
  2. Now that we have a number for HV/SV, we will compare it to the IV number that was an input. If HV > IV, then we will output a  BUY decision. If HV < IV, then we will output a SELL decision.
  3. We will take the Current Stock price that was given as an input, and we will multiply it by the Implied Volatility input and the square root of the days to expiration. Lastly, we will divide this number by the square root of 254, and add and subtract this number from the current price to get our range.
  4. After we have calculated an upper bound from step three, we will take the upper bound number and subtract the current stock price from it. Once we have this difference, we will multiply it by the delta value, then divide by the Vega value to come up with the necessary change in % of volatility.
  5. This was already calculated in the last step, but the new THEORETICAL option premium is equal to the current premium plus the difference in the current stock price and upper bound of the range calculated in step 3 multiplied by Delta.
  6. Simply, the theoretical option price minus the current option premium multiplied by 100.
Note that the calculations will vary based on whether we are BUYING a put/call, or SELLING a put/call. This will be detailed in the code. I will be making a LITE and PRO version of the tool, I will provide a link to the LITE version of the code. However, the PRO version of the tool, which will contain many enhancements, will be for sale. If you are experienced option trader, then you will note that I left out Gamma which is critical for determining the "acceleration" of an option premium. The PRO version will incorporate this input into its pricing model, but for simplicities sake, the LITE version will assume more linear/basic movement.

I know this is a lot to digest...So again, if you have any question please email me at

Part 3 will consist of links to the actual source code, as well as a demonstration of the tool using a current option.

No comments:

Post a Comment