View on GitHub

Black-Scholes in Java

Automatically exported from

Download this project as a .zip file Download this project as a tar.gz file

Welcome to Java Black-Scholes valuation engine

Author: Michael Bret (mBret) Blackford

  = Java Black-Scholes valuation engine =

=Java Black-Scholes valuation engine=

Author: Michael Bret (mBret) Blackford

Unable to find any well documented Java source code for the Black-Scholes option model I decided to write my own. This project contains the following Java classes which generate a mark-to-model (MtM):

  1. BlackScholesFormula: this class attempts to clearly layout the Black-Scholes model as expressed in the formula. Each step is defined.

    • the calculate() method will return the a double with the calculated MtM
    • the calculateWithGreeks() will return the MtM value along with the greeks (delta, gamma, rho, theta, and vega)
  2. BlackScholes_Abbreviated: this class obfuscates the Black-Scholes equation.

    • blackScholesCall() returns the MtM as a double. Relies on the Apache Common Math Library for the NormalDistributionImpl class.
  3. Black_76: this class implements the Black 76 option model.

    • Black76() method returns a double with the MtM.


Useful information was found at the following websites …

In addition to the Black-Scholes classes described above I also wrote some code to extract data from a Db (using jdbc, which requires the ojdbc.jar). The Black-Scholes classes are then used to calculate the MtM for the data in the extracted result set. Output is written to Excel using the Apache POI.

==== The input parameters to the Black-Scholes option valuation model are ... ====

==== The option greeks are … ====

An interesting article from the BBC here, with companion video below.


External Links:

Authors and Contributors

M Bret Blackford (@bret-blackford)