Esempio n. 1
0
        public static double PayOffEvaluation(
            [Parameter("PayOff")] ArgumentList payOff,
            [Parameter("Point for evaluation")] double spot)
        {
            PayOffBase payOffBase = Factory.GetInstance <PayOffBase>(payOff);

            // Note: In the above line there is an implicit conversion of payOff
            // from type ArgumentList to type Dictionary<String, Object>.
            // We could write this conversion explicitly in two steps:
            // Dictionary<String, Object> payOffDictionary = payOff;
            // PayOffBase payOffBase = Factory.GetInstance<PayOffBase>(payOffDictionary);
            return(payOffBase.Payoff(spot));
        }
Esempio n. 2
0
 public override double Payoff(double spot)
 {
     return(_volume1 * _payOff1.Payoff(spot) + _volume2 * _payOff2.Payoff(spot));
 }