Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking to program the Black Scholes model, but I don't understand how to write this equation as basic math.

Example values

  • Type: Put
  • StockPrice: 19
  • StrikePrice: 20
  • YearsToMaturity: 0.16
  • RiskFreeRate: 0.10
  • Volatility: 0.60

I can get all of these inputs, but I just need to program the basic calculation, like (these are just made up numbers and equations)

f = a + (b/c);
f * f = z;
z / 3 + ( f * a ) = m;

m is the answer.

share|cite|improve this question
up vote 5 down vote accepted

Espen Haug, the guy famous for his book on option formulas, implements Black Scholes in several languages/platforms here.

share|cite|improve this answer
Perfect ! thank you – Kirk Strobeck Feb 28 '12 at 17:51

This can be done very very easily in Excel. All you're doing is:

$C_t = S_t N(d_1) - N(d_2) K e^{-r(T-t)}$

where $d_1$ and $d_2$ are constants obtained through elementary calculations, $N(.)$ is the NormSdist function in Excel, and $S$, $K$ and $e^{-r(T-t)}$ are also easy to compute.

This is for a call; but it's almost the same thing as for a put.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.