Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
add comment

2 Answers

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|improve this answer
    
Perfect ! thank you –  Kirk Strobeck Feb 28 '12 at 17:51
add comment

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|improve this answer
add comment

Your Answer

 
discard

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.