Beispiel #1
0
        public ADouble OisAnnuityAD(OisSchedule schedule, InterpMethod interpolation)
        {
            ADouble output = 0.0;
            ADouble discFactor;

            for (int i = 0; i < schedule.AdjEndDates.Count; i++)
            {
                discFactor = DiscFactor(schedule.AsOf, schedule.AdjEndDates[i], schedule.DayCount, interpolation);
                output     = output + schedule.Coverages[i] * discFactor;
            }
            return(output);
        }
Beispiel #2
0
        public OisSwap(DateTime asOf, string startTenor, string endTenor, string settlementLag, DayCount dayCountFixed,
                       DayCount dayCountFloat, DayRule dayRule, double notional, double fixedRate, int tradeSign)
        {
            DateTime startDate = DateHandling.AddTenorAdjust(asOf, startTenor, dayRule);

            startDate = DateHandling.AddTenorAdjust(startDate, settlementLag, dayRule);
            DateTime endDate = DateHandling.AddTenorAdjust(startDate, endTenor, dayRule);

            this.AsOf          = asOf;
            this.StartDate     = startDate;
            this.EndDate       = endDate;
            this.FloatSchedule = new OisSchedule(asOf, startTenor, endTenor, settlementLag, dayCountFloat, dayRule);
            this.FixedSchedule = new OisSchedule(asOf, startTenor, endTenor, settlementLag, dayCountFixed, dayRule);
            this.Notional      = notional;
            this.FixedRate     = fixedRate;
            this.TradeSign     = tradeSign;
        }