public override double payoff(double S1, double S2) { if (type == 1) // Comparisons.Max { return(Comparisons.Max(w * Comparisons.Max(S1, S2) - w * K, 0.0)); } return(Comparisons.Max(w * Comparisons.Min(S1, S2) - w * K, 0.0)); }
public override double payoff(double S1, double S2) { if (w == 1) // Best { return(Comparisons.Max(S1, S2, K)); } return(Comparisons.Min(S1, S2, K)); }
public override double payoff(double S1, double S2) { double min = Comparisons.Min(S1, S2); return(Comparisons.Max(w * (n1 * S1 + n2 * S2 - K), 0.0)); }