2007/09/12

Black-Scholes Options Calculator for Maemo


After so much time, I did something new for Maemo: a Black-Scholes call options calculator. It is useful for investors that are following the price of some call options and want to compare the theoretical (Black-Scholes) price with the market price, to buy them "cheap" or sell'em expensive.

You can download the source here. It is still a prototype, so there are a lot of things to do, and the first one is to make a installable Debian package.

Features of the current version:

-> Works in Python for Maemo as well as in Python for Linux. Does not depend on any special Python module. In fact this applet grew out of a Python sample from QuantLib, but I simply couldn't port QuantLib to Maemo, so I preferred to use the raw formulas.

-> Persistent data (all the values you chose are saved for the next session in a DBM file).

-> Can follow up to five call options at the same time.

-> Initial date is today (be sure to have the date/time settings correct!), expiration date is chosen in the Calendar widget.

-> The columns in the lower part of the screen are: 1) strike price, that you can choose; 2) Option value based on Black-Scholes formulas (with intrinsic value between parenthesis); 3) Delta; 4) Gamma; 5); Vega; 6) Theta.


I plan to add the following features in next versions:

-> Python for Series 60 version

-> Proper packages for all platforms

-> Automatic download of market quotes, underlying stock volatility etc.

-> Better UI with 'greeks' properly identified

-> Perhaps a Javascript version for Web.

The 'greeks' measure the sensitivity of option price to the elements, and are expressed in the following units:

-> Deltas are in %P/S -- how many % the option price (the premium, P) will change given a change in the underlying stock price (S). If delta is 15%, the option price will rise $0.15 for $1 of rise in stock price.

-> Gammas are in % delta/S -- how much the delta itself will change in % for a given change in stock price. If delta is 15% and gamma is 5%, delta rises to 20% if the stock raises $1.

-> Vegas are in % P/V -- how much % the premium will change for 1% change in volatility. Suppose a vega of 5%. If volatility was 18%/year and rises to 20%/year (2% points rise), the option price would rise 10% (5x2). Options are generally very sensitive to volatility changes.

-> Thetas are in %P/t -- how many % the premium will fall every day, given all other conditions equal. If theta is 14%, and option price is $1.00 today, tomorrow it will be worth $0.86. Theta is not the same during the lifetime of a call; it gets more and more negative for out-of-the-money calls as expiration gets closer.

I preferred to put all greeks "normalized" in %/premium, since I feel it's easier to understand them that way. Most financial textbooks show formulas that produce absolute-value greeks, so be aware of that if comparing results with this calculator.