Example #1
0
        public static Calculation CreateFixed(decimal fixedRate, decimal discountRate, Money notional,
                                              CompoundingMethodEnum compoundingMethod, DayCountFraction dayCountFraction, DiscountingTypeEnum discountingType)
        {
            var calculation = new Calculation
            {
                Item = NotionalFactory.Create(notional),
                compoundingMethod          = compoundingMethod,
                compoundingMethodSpecified = true,
                dayCountFraction           = dayCountFraction,
                discounting =
                    DiscountingHelper.Create(discountRate, dayCountFraction,
                                             discountingType),
                Items = new object[] { FixedRateScheduleHelper.Create(fixedRate) }
            };

            return(calculation);
        }
Example #2
0
        public static Calculation CreateFixed(decimal fixedRate, NonNegativeAmountSchedule notionalSchedule,
                                              DayCountFraction dayCountFraction, DiscountingTypeEnum?discountingType)
        {
            var discounting = discountingType != null
                                  ? DiscountingHelper.Create(fixedRate, dayCountFraction, (DiscountingTypeEnum)discountingType)
                                  : null;

            var calculation = new Calculation
            {
                Item = NotionalFactory.Create(notionalSchedule),
                compoundingMethod          = CompoundingMethodEnum.None,
                compoundingMethodSpecified = true,
                dayCountFraction           = dayCountFraction,
                discounting = discounting,
                Items       = new object[] { FixedRateScheduleHelper.Create(fixedRate) }
            };

            return(calculation);
        }