Exemple #1
0
 public override void updatePath(List <KeyValuePair <Date, double> > events,
                                 NotionalPath path)
 {
     path.reset();
     for (int i = 0; i < events.Count; ++i)
     {
         if (events[i].Value >= threshold_)
         {
             path.addReduction(paymentOffset_.paymentDate(events[i].Key), 0.0);
         }
     }
 }
Exemple #2
0
        public override void updatePath(List <KeyValuePair <Date, double> > events, NotionalPath path)
        {
            path.reset();
            double losses           = 0;
            double previousNotional = 1;

            for (int i = 0; i < events.Count; ++i)
            {
                losses += events[i].Value;
                if (losses > attachement_ && previousNotional > 0)
                {
                    previousNotional = Math.Max(0.0, (exhaustion_ - losses) / (exhaustion_ - attachement_));
                    path.addReduction(paymentOffset_.paymentDate(events[i].Key), previousNotional);
                }
            }
        }