protected SwapLeg(DateTime asOf, DateTime startDate, DateTime endDate, CurveTenor referenceTenor, DayCount dayCount, DayRule dayRule, double notional) { Schedule = new MasterThesis.SwapSchedule(asOf, startDate, endDate, dayCount, dayRule, referenceTenor); this.Tenor = referenceTenor; this.DayRule = dayRule; this.DayCount = dayCount; this.Notional = notional; this.AsOf = asOf; this.StartDate = startDate; this.EndDate = endDate; }
public ADouble AnnuityAD(DateTime asOf, DateTime startDate, DateTime endDate, CurveTenor tenor, DayCount dayCount, DayRule dayRule, InterpMethod interpolation) { SwapSchedule annuitySchedule = new SwapSchedule(asOf, startDate, endDate, dayCount, dayRule, tenor); ADouble result = 0.0; for (int i = 0; i < annuitySchedule.AdjEndDates.Count; i++) { result = result + annuitySchedule.Coverages[i] * ADDiscCurve.DiscFactor(asOf, annuitySchedule.AdjEndDates[i], dayCount, interpolation); } return(result); }
public ADouble AnnuityAD(SwapSchedule Schedule, InterpMethod Method) { return(AnnuityAD(Schedule.AsOf, Schedule.StartDate, Schedule.EndDate, Schedule.Frequency, Schedule.DayCount, Schedule.DayRule, Method)); }