fbpx

C++: Black Scholes Put Option Theta

Bjarne-stroustrup
 

// Calculate the Black Scholes European put option Theta
double BS_Put_Option_Theta(double S, double K, double r, double v, double T) 
// Parameters: (S = Current Stock Price, K = Strike Price, r = Risk-Free Rate, v = Volatility of Stock Price, T = Time to Maturity)
{  return -(S*Normal_PDF(d_j(1, S, K, r, v, T))*v)/(2*sqrt(T))   + r*K*exp(-r*T)*Normal_CDF(-d_j(2, S, K, r, v, T)); }

const double Pi = 3.14159265359;

// Standard Normal cumulative distribution function
double Normal_CDF(const double & x) 
{  
	double k = 1.0/(1.0 + 0.2316419 * x);
	double k_sum = k * (0.319381530 + k * (-0.356563782 + k * (1.781477937 + k * (-1.821255978 + 1.330274429 * k))));

	if (x >= 0.0) 
	{  return (1.0 - (1.0/(pow(2*Pi,0.5)))*exp(-0.5*x*x) * k_sum); } 
	else 
	{  return 1.0 - Normal_CDF(-x); } 
}

Our team found a curious site for our readers that are fans of online gaming, a rather exciting site that provides the latest gaming technology. Casinodots.com is the site, they compile the best reviews of MGA casino utan svensk licens sites. This site might pique your curiosity and you can win extra money!