src/main/java/com/billybyte/dse/models/vanilla/BachelierEd.java
public static Double callPrice(
			double EDFuture,
			double EDStrike,
			double sigma,
			double riskFreeRate,
			double timeToExpiry){
		
		//EXP(-r_*T_)*((K_-F_)*N_d1+sigma*SQRT(T_)*probDensity(d1))
		// d1 = (F_-K_)/(sigma*SQRT(T_))
		double K = 100-EDStrike;
		double F = 100-EDFuture;
		double d1 = (F-K)/(sigma*Math.sqrt(timeToExpiry));
		double N_d1 = NormalDistribution.cumulativeDistribution(-d1);
		double probDensity = NormalDistribution.probabilityDensity(d1);
		double call = Math.exp(-riskFreeRate*timeToExpiry)*(  (K-F)*N_d1  +  sigma*Math.sqrt(timeToExpiry)*probDensity  );
		
		return call;
	}
// call and put are reverese for ED's
call and put are reverese for ED's
call and put are reverese for ED ' s
public static Double callPrice(
			double EDFuture,
			double EDStrike,
			double sigma,
			double riskFreeRate,
			double timeToExpiry){
		double K = 100-EDStrike;
		double F = 100-EDFuture;
		double d1 = (F-K)/(sigma*Math.sqrt(timeToExpiry));
		double N_d1 = NormalDistribution.cumulativeDistribution(-d1);
		double probDensity = NormalDistribution.probabilityDensity(d1);
		double call = Math.exp(-riskFreeRate*timeToExpiry)*(  (K-F)*N_d1  +  sigma*Math.sqrt(timeToExpiry)*probDensity  );
		return call;
	}
public static Double callPrice ( double EDFuture , double EDStrike , double sigma , double riskFreeRate , double timeToExpiry ) { double K = 100 - EDStrike ; double F = 100 - EDFuture ; double d1 = ( F - K ) / ( sigma * Math . sqrt ( timeToExpiry ) ) ; double N_d1 = NormalDistribution . cumulativeDistribution ( - d1 ) ; double probDensity = NormalDistribution . probabilityDensity ( d1 ) ; double call = Math . exp ( - riskFreeRate * timeToExpiry ) * ( ( K - F ) * N_d1 + sigma * Math . sqrt ( timeToExpiry ) * probDensity ) ; return call ; }
call and put are reverese for ED's
call and put are reverese for ED ' s
//EXP(-r_*T_)*((K_-F_)*N_d1+sigma*SQRT(T_)*probDensity(d1)) // d1 = (F_-K_)/(sigma*SQRT(T_))