/// <summary>Gets the start and end date of the timeframe. /// </summary> /// <param name="referenceDate">A reference date (can be a business day or a holiday).</param> /// <param name="holidayCalendar">The (settlement) holiday calendar.</param> /// <param name="startDate">The start date of the time span with respect to <paramref name="referenceDate"/> (output).</param> /// <param name="endDate">The end date of the time span with respect to <paramref name="referenceDate"/> (output).</param> /// <param name="logger">An optional logger.</param> public void GetStartAndEndDate(DateTime referenceDate, IHolidayCalendar holidayCalendar, out DateTime startDate, out DateTime endDate, ILogger logger = null) { var IMMDate = Next(referenceDate); startDate = StartDateAdjustment.GetAdjustedDate(IMMDate, holidayCalendar); endDate = EndDateAdjustment.GetAdjustedDate(startDate.AddTenorTimeSpan(Tenor), holidayCalendar); }
/// <summary>Gets the start and end date of the timeframe. /// </summary> /// <param name="referenceDate">A reference date (can be a business day or a holiday).</param> /// <param name="holidayCalendar">The (settlement) holiday calendar.</param> /// <param name="fixingLag">The fixing lag, i.e. a method used to calculate the fixing date with respect to the period. Will be applied to the IMM Date (even if the IMM date is not a business day).</param> /// <param name="startDate">The start date of the time span with respect to <paramref name="referenceDate"/> (output).</param> /// <param name="endDate">The end date of the time span with respect to <paramref name="referenceDate"/> (output).</param> /// <param name="logger">An optional logger.</param> /// <returns>The fixing date of with respect to the (interest) period.</returns> public DateTime GetStartAndEndDate(DateTime referenceDate, IHolidayCalendar holidayCalendar, IFixingLag fixingLag, out DateTime startDate, out DateTime endDate, ILogger logger = null) { var IMMDate = Next(referenceDate); startDate = StartDateAdjustment.GetAdjustedDate(IMMDate, holidayCalendar); endDate = EndDateAdjustment.GetAdjustedDate(startDate.AddTenorTimeSpan(Tenor), holidayCalendar); return(fixingLag.GetFixingDate(IMMDate, holidayCalendar)); }