Next: The Rendleman and Bartter Up: Fixed Income modelling, with Previous: Fixed Income modelling, with   Contents   Index

Subsections

# Black Scholes bond pricing.

The Black Scholes model can be used under restrictive assumptions, but the constant volatility assumption of the bond price is unrealistic.

### Computer algoritm, Bond option price, Black Scholes

```// file bondopt_bs_call.cc
// author: Bernt A Oedegaard.

#include <cmath>
#include "normdist.h"

double bond_option_price_call_zero_black_scholes(
double B, double X, double r, double sigma, double time)
{
double time_sqrt = sqrt(time);
double d1 = (log(B/X)+r*time)/(sigma*time_sqrt) + 0.5*sigma*time_sqrt;
double d2 = d1-(sigma*time_sqrt);
double c = B * N(d1) - X * exp(-r*time) * N(d2);
return c;
};
```

```// file bondopt_call_coupon.cc
// author: Bernt A Oedegaard.

#include <cmath>
#include "normdist.h"
#include "fin_algoritms.h"

double bond_option_price_call_coupon_bond_black_scholes(
double B, double X, double r, double sigma, double time,
vector<double> coupon_times, vector<double> coupon_amounts){
for (unsigned int i=0;i<coupon_times.size();i++) { // subtract present value of coupons
if (coupon_times[i]<=time) { // coupon paid befor option expiry
B -= coupon_amounts[i] * exp(-r*coupon_times[i]);
};
};
return bond_option_price_call_zero_black_scholes(B,X,r,sigma,time);
};
```

Next: The Rendleman and Bartter Up: Fixed Income modelling, with Previous: Fixed Income modelling, with   Contents   Index
Bernt Arne Odegaard
1999-09-09