Microsoft Windows and Java applications

C++ Anagram Generator

 

In March 2003, I rewrote my Java anagram generator in the programming language C++ to run on Windows platforms. This was mainly so I could learn about Windows programming. In the process I made a few improvements to it. The old Java one can still be found here.

Right click on winanagram.zip to download the new native Windows anagram generator.

 

Black-Scholes Option Pricing

 

Right click on blackscholes.zip to download the Black-Scholes option pricing calculator for Microsoft Windows platforms as a compressed ZIP file. Although this equation has been implemented thousands of times before, my motivation here is to provide a standalone Windows user interface to the model. If floating point arithmetic over or underflows the application will report it.

I assume no responsibility for the correctness of this software and it should not be used as a basis for trading decisions.

The formulas used are:
Call option fair price = S0N(d1) - Xe-rtN(d2)
Put option fair price = Xe-rtN(-d2) - S0N(-d1)
where

  • X is the exercise price
  • S0 is the price of asset at time 0
  • N(x) is the cumulative normal distribution
  • r is the riskless rate of interest
  • t is the length of time until maturity
  • d1 = ( (ln(S0/X) + rt)/(sigma * t½) ) + (½ * sigma * t½)
  • d2 = d1 - sigma * t½
  • sigma is the volatility

The main assumptions of this model are:

  • The option is European style and so cannot be exercised before maturity.
  • The underlying asset pays no dividends before maturity.



HomeBack to Martin's home page