Ejemplo n.º 1
0
        /// <summary>
        /// Return a Cashflows object containing array of the payment calculation periods and array of principal exchanges.
        /// </summary>
        /// <param name="paymentCalendar"> </param>
        /// <param name="interestRateStream">The interest rate stream.</param>
        /// <param name="rollDates">The list of roll dates.</param>
        /// <returns></returns>
        public static Cashflows GetCashflows(List <DateTime> rollDates, IBusinessCalendar paymentCalendar, InterestRateStream interestRateStream)
        {
            CalculationPeriodsPrincipalExchangesAndStubs calculationPeriodsPrincipalExchangesAndStubs =
                StreamCashflowsGenerator.GenerateCalculationPeriodsPrincipalExchangesAndStubsFromRollDates(interestRateStream, rollDates, paymentCalendar);

            return(GetCashfows(interestRateStream, calculationPeriodsPrincipalExchangesAndStubs, paymentCalendar));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return a Cashflows object containing array of the payment calculation periods and array of principal exchanges.
        /// </summary>
        /// <param name="interestRateStream">The interest rate stream.</param>
        /// <param name="fixingCalendar"> </param>
        /// <param name="paymentCalendar"> </param>
        /// <returns></returns>
        public static Cashflows GetCashflows(InterestRateStream interestRateStream, IBusinessCalendar fixingCalendar, IBusinessCalendar paymentCalendar)
        {
            CalculationPeriodsPrincipalExchangesAndStubs calculationPeriodsPrincipalExchangesAndStubs =
                StreamCashflowsGenerator.GenerateCalculationPeriodsPrincipalExchangesAndStubs(interestRateStream, fixingCalendar, paymentCalendar);

            return(GetCashfows(interestRateStream, calculationPeriodsPrincipalExchangesAndStubs, paymentCalendar));
        }
Ejemplo n.º 3
0
        private static Cashflows GetCashfows(
            InterestRateStream interestRateStream, CalculationPeriodsPrincipalExchangesAndStubs calculationPeriodsPrincipalExchangesAndStubs,
            IBusinessCalendar paymentCalendar)
        {
            // Assign notionals, rates, cap/floor rate, etc
            //
            StreamCashflowsGenerator.UpdateCalculationPeriodsData(interestRateStream, calculationPeriodsPrincipalExchangesAndStubs);
            List <PaymentCalculationPeriod> paymentCalculationPeriods = StreamCashflowsGenerator.GetPaymentCalculationPeriods(interestRateStream, calculationPeriodsPrincipalExchangesAndStubs, paymentCalendar);
            Calculation calculation = XsdClassesFieldResolver.CalculationPeriodAmountGetCalculation(interestRateStream.calculationPeriodAmount);

            UpdateNumberOfDaysAndYearFraction(paymentCalculationPeriods, calculation);
            return(CashflowsFactory.Create(paymentCalculationPeriods, calculationPeriodsPrincipalExchangesAndStubs.GetAllPrincipalExchanges(), true));//TODO THe cashflowsmatch paraqmeter at the end could be a problem!
        }