Fix bugs, clean up code, standardize MC Greeks

This commit is contained in:
Kevin Keogh
2017-07-25 23:10:05 -04:00
parent 15d750abf1
commit 785c546ba3
4 changed files with 39 additions and 27 deletions

View File

@@ -22,5 +22,5 @@ void bsm(struct Option *opt)
price = opt->spot * normalcdf(d1 * opt->type) * opt->type - opt->strike *
exp(-opt->rfr * tte) * normalcdf(d2 * opt->type) * opt->type;
opt->fv = price;
opt->vega = opt->spot * exp(-opt->rfr * tte) * pow(tte, 0.5) * normalpdf(d1);
opt->vega = opt->spot / 100 * exp(-opt->rfr * tte) * pow(tte, 0.5) * normalpdf(d1);
}