Saturday, November 28, 2015

Implied volatility vs delta

The clasification of options between out-of-the-money, in-the-money, and at-the-money will be a determining factor in properly applying the extraction methodology and obtain meaningful results for different options monsters. After some python experimentation, the dataset is ready to be analyzed and available for calculations. My question today revolves around the the mening of the obtained graf in delta vs. volatility space.

The shape from the graph makes sense, since delta values for calls and puts are positive and negative. Volatility is positive since is the percent change and is provided by the courtesy of Yahoo! finance. On this note, I will spend some time in finding out two things:

1. How does yahoo! finance calculate implied volatility? (probably BS!)

2. What Risk free rate do they use for calculations?

Literature and internet review showed that many people that deal with the BS formula omit the discussion about the risk free rate and its estimation or use. Given that IV is provided, one can extract the risk free rate from it. Once I compounded the BS formula with D-parameters, I came to find out that this will not be a simple task to do. The r parameter is found both in the original equation and in the proces of calculating the normal distribution. Have fun whomever will decide to figure this out!!! :)

Lastly.... from one paper where deltas and implied volatilities are plotted, only positive deltas are used for both calls and puts that are out-of-the-money. Were deltas put in absolute values to extract the estimation function?

Saturday, November 21, 2015

Python can keep you entertained all day!

It was about time. As the route in implementing probability density functions to option data is somewhat leghty, being as stubborn as I am, I continued with solving problems regarding data acquisition and preparation for further calculations and analysis.

Data from yahoo! finance is an excellent medium to observe options prices and doing simple quests and calculations for the unindexed parameters. The best part, that such data became freely available to the public (I do not know exactly where it comes from, but for studying and testing purposes is excellent). However, making use of the Black Scholes formula with the downloaded data is a total nightmare to obtain (yes, I can save you some time with my going around the bush script if you want to come up to speed with this development).

After a nice day with reading about python, I finally made a put-call graph that normally you do not see in any classes. I will polish it and make it more readable in the future.

Sunday, November 8, 2015

Life made simple

Learning new computer tools is always a challange and a new adventure to get your mind wrapped around a problem. With some useful links and online hints the desired algorithm may well one day come to life.

Automation of programming tasks using free data sources with simple calculations techiques and file exporting is made simple with python and no wonder why it is becoming a predominant laguage in the finance field. Just as an example, data from yahoo finance is downloaded with one simple command:

df = web.DataReader("SPY", 'yahoo', start, end)

as data is a time series of basic end of the day fields (High, Low, Open, Close, Volume), calculations are made extremelly simple since python interprets variables just like matlab. With one line of code a new column is added to the imported variable. And what is better yet, many stock indicators are already incorporated in different libraries, it is just a matter of finding the right one or all of them to incorporate them into the learning model. There are several hundred stocks published on yahoo and the end of the day approach can be easily transfered to other candle sticks with different time frames or windows. The found process on free resources has a great potential to become a state of the art trading tool its just a matter of focusing on the right set for troughtful analysis and back testing.

What is even cooler, is the simplicity of exporting manipulated data to a hard drive to use with other applications (not Excel tough). it is just a matter of one line of code:

df.to_csv('/home/t/Documents/Python/file.csv')

As an interesting observation of the day is a visualization of IBM and SPY stock once we plot for volume and price change between open and close prices. As noted, the volume on the IBM stock does not vary a lot, but the change in price does (vertical line) on the SPY stock instead, volume values are a complete big bang scattered on the plane meaning that given a high volume turnover, there will be equally likely that the price change between open and close will be high as well (be it positive or negative). I would like to know from a practical perspective, what does this means :)