示例#1
0
        /// <summary>Gets an adapted copy of the current date schedule rule.
        /// </summary>
        /// <param name="referenceDate">The reference date.</param>
        /// <returns>A <see cref="BackwardDateScheduleRule"/> object with the same parameter except the reference date used to calculate the start and end date.</returns>
        /// <remarks>Use this method if a the current object is created via the
        /// <see cref="BackwardDateScheduleRule(ITimeframeDescription, IDateScheduleFrequency, IBusinessDayConvention, IBusinessDayConvention, DateTime?, DateTime?)"/> constructor.</remarks>
        private BackwardDateScheduleRule GetAdaptedDateScheduleRule(DateTime referenceDate)
        {
            BackwardDateScheduleRule dateSchedule = new BackwardDateScheduleRule(m_TimeSpanDescription, m_Frequency, m_BusinessDayConvention, m_SeedBusinessDayConvention, m_FirstRegularDate, m_LastRegularDate);

            dateSchedule.m_ReferenceDate = referenceDate;
            return(dateSchedule);
        }
示例#2
0
 /// <summary>Initializes a new instance of the <see cref="DateScheduleRuleDescription "/> class.
 /// </summary>
 /// <param name="startAndEndDateDescription">The description of the start and of the end date of the date schedule.</param>
 /// <param name="frequency">The frequency.</param>
 /// <param name="businessDayConvention">The business day convention.</param>
 /// <param name="seedBusinessDayConvention">The optional seed business day convention, represents the adjustment of the
 /// 'seed date' used in the main date generation loop, i.e. generates
 /// <para>
 ///     'adjusted seed date' - j * tenor, j=1,2,...
 /// </para>
 /// and adjust these dates with respect to <paramref name="businessDayConvention"/> (optional; will be ignored if <paramref name="firstRegularDate"/> is a date).
 /// </param>
 /// <param name="firstRegularDate">The first regular date (optional).</param>
 /// <param name="lastRegularDate">The last regular date (optional).</param>
 /// <remarks>The optional <paramref name="firstRegularDate"/> and <paramref name="lastRegularDate"/> are used to generated a short/long first/last stub period.</remarks>
 public DateScheduleRuleDescription(ITimeframeDescription startAndEndDateDescription, IDateScheduleFrequency frequency, IBusinessDayConvention businessDayConvention, IBusinessDayConvention seedBusinessDayConvention, DateTime?firstRegularDate = null, DateTime?lastRegularDate = null)
 {
     m_DateScheduleRule = new BackwardDateScheduleRule(startAndEndDateDescription, frequency, businessDayConvention, seedBusinessDayConvention, firstRegularDate, lastRegularDate);
 }