1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #include "prototype.h"
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
double S,K,T,r,sigma,option_price,ns;
//blackscholesmontecarlo(S,K,T,r,sigma)
cout << "Put Option Monte Carlo: " << blackscholesmontecarlo(59,58,4/12.,0.05,0.25) << endl;
cout << "ecart: " << confident_interval(59,58,4/12.,0.05,0.25) << endl;
cout << blackscholesmontecarlo(59,58,4/12.,0.05,0.25) + confident_interval(59,58,4/12.,0.05,0.25);
//impliedvol(S,K,T,r,option_price)
cout << "Implied Volatility: " << impliedvol(1,0.9,0.5,0.05,0.1264) << endl << endl;
system("pause");
return 0;
} |
Partager