// Method: Calculate the Delta public double Delta() { if (COP == 1) { return(Formula.CND(D1)); } else { return(Formula.CND(D1) - 1); } }
// Method: calculate the price public double Price() { if (COP == 1) // For Call { return(S * Formula.CND(D1) - X * Formula.CND(D2)); // Calculate the premium according "London Info-Flash No.LO09/08" } if (COP == -1) // For Put { return(X * Formula.CND(-D2) - S * Formula.CND(-D1)); // Calculate the premium according "London Info-Flash No.LO09/08" } return(0); }