Author: Michael Bret (mBret) Blackford
Unable to find any well documented Java or JavaScript based source code for the Black-Scholes option model I decided to write my own. This project contains the following JavaScript classes which generate a mark-to-model (MtM):
- BlackScholes() : this class attempts to clearly layout the Black-Scholes model as expressed in the formula. Each step is defined.
- CND() : The cummulative Normal distribution function:
Useful information was found at the following websites …
- BlackScholes.java by Robert Sedgewick and Kevin Wayne -- http://introcs.cs.princeton.edu/java/22library/BlackScholes.java.html
- A decomposed implementation in Java by Dhruba Bandopadhyay … http://dhruba.name/2012/08/22/the-black-scholes-algorithm-a-decomposed-implementation-in-java/
- Black-Scholes in Multiple Languages … http://cseweb.ucsd.edu/~goguen/courses/130/SayBlackScholes.html
- ~~Jernej Kovse … dead link ~~
- Black-Scholes in Java by M. Bret Blackford … https://bret-blackford.github.io/black-scholes/ and https://code.google.com/archive/p/black-scholes/
==== The input parameters to the Black-Scholes option valuation model are ... ====
- s = Spot price of underlying stock/asset
- k = Strike price
- r = Risk free annual interest rate continuously compounded
- t = Time in years until option expiration (maturity)
- v = Implied volatility of returns of underlying stock/asset
==== The option greeks are … ====
- Delta Δ - measures the rate of change of option value with respect to changes in the underlying asset's price. Measures the exposure of option price to movement of underlying stock price
- Vega ν - measures sensitivity to volatility. Measures the exposure of the option price to changes in volatility of the underlying
- Theta Θ - measures the sensitivity of the value of the derivative to the passage of time. Measures the exposure of the option price to the passage of time
- Rho ρ - measures sensitivity to the interest rate: it is the derivative of the option value with respect to the risk free interest rate
- Lambda Λ - omega, or elasticity is the percentage change in option value per percentage change in the underlying price, a measure of leverage, sometimes called gearing.
- Gamma Δ - measures the rate of change in the delta with respect to changes in the underlying price. Measures the exposure of the option delta to the movement of the underlying stock price
External Links: