Binomial Option Pricing

Hi All
This is one of my attempt to code the financial algorithms in Java with aim of finally developing a good set of API which will be available for use by the community.
I will continue to post the java code in zip format along with a few pointers on how to use them and what to expect in the zip file.
Feel free to make/suggest changes in order to improve the code etc.

Please access the code at following link: click here


In case anyone finds difficulty in downloading, do not hesitate to let me know.

The current set of files has following :
a. InterestRateUtils having a few utility methods to caclulate EAR. It is self explanatory to use,
b. TimeValueUtils having a few methods to calculate the present value and future value of cash flows. It consists of API's both, a single cash flow as well as a series of cash flow. It is self explanatory to use.
c. API's for calculate option prices using Binomial Pricing method. The API can be used for both CALL as well as PUT option. Though the API does need refinement, the results obtained seem to be ok.

You need to look at the TreeGenerator.java file in order to understand how to use these.Basically, you will need to create a TreeGenerator class passing it with the stock, option, risk free rate and step size.
Then, you call the tree.getRootNode() to get the starting node of the binomial tree. Finally, calling getOptionValue() on the rootNode() will return the optionPrice.

Please see the sample code below:

TreeGenerator tree =new TreeGenerator(new Option(800,.5,OptionType.CALL), new Stock(810,.2), .03, .25);
TreeNode node =tree.getRootNode();
System.out.println(node.getOptionValue());


Feel free to make/suggest changes in order to improve the code etc.Also let me know any other algorithms you may want to be developed.


Comments

Popular posts from this blog

Conversation between Self Proclaimed Sophists

The Asocial Networking (Must Read)