public static DayCountFraction ToDayCountFraction(DayCountFractionEnum dayCountFractionEnum) { string dayCountFractionString = DayCountFractionScheme.GetEnumString(dayCountFractionEnum); var result = new DayCountFraction { Value = dayCountFractionString }; return(result); }
public static Discounting Create(decimal discountingRate, DayCountFraction dayCountFraction, DiscountingTypeEnum discountingTypeEnum) { var discounting = new Discounting { discountingType = discountingTypeEnum, discountRate = discountingRate, discountRateDayCountFraction = dayCountFraction //discountRateSpecified = true }; return(discounting); }
public static Calculation CreateFloating(decimal fixedRate, Money notional, FloatingRateIndex floatingRateIndex, Period tenor, DayCountFraction dayCountFraction, DiscountingTypeEnum discountingType) { var calculation = new Calculation { Item = NotionalFactory.Create(notional), compoundingMethod = CompoundingMethodEnum.None, compoundingMethodSpecified = true, dayCountFraction = dayCountFraction, discounting = DiscountingHelper.Create(fixedRate, dayCountFraction, discountingType), Items = new object[] { FloatingRateCalculationHelper.CreateFloating(floatingRateIndex, tenor) } }; return(calculation); }
public static Discounting Create(decimal?discountingRate, DayCountFraction dayCountFraction, DiscountingTypeEnum discountingTypeEnum) { var discounting = new Discounting { discountingType = discountingTypeEnum, discountRateDayCountFraction = dayCountFraction //discountRateSpecified = true }; if (discountingRate != null) { discounting.discountRate = (decimal)discountingRate; } return(discounting); }
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); }
public static RateIndex Create(string instrumentId, FloatingRateIndex floatingRateIndex, Currency currency, DayCountFraction dayCountFraction, Period paymentFrequency, Period term) { RateIndex rateIndex = new RateIndex(); rateIndex.currency = new IdentifiedCurrency() { Value = currency.Value }; rateIndex.dayCountFraction = dayCountFraction; rateIndex.floatingRateIndex = floatingRateIndex; rateIndex.id = instrumentId; rateIndex.instrumentId = InstrumentIdArrayHelper.Parse(instrumentId); rateIndex.paymentFrequency = paymentFrequency; rateIndex.term = term; return(rateIndex); }
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); }
public static Calculation CreateFloating(Money notional, FloatingRateIndex floatingRateIndex, Period tenor, DayCountFraction dayCountFraction, DiscountingTypeEnum discountingType) { var calculation = new Calculation { Item = NotionalFactory.Create(notional), compoundingMethod = CompoundingMethodEnum.None, compoundingMethodSpecified = true, dayCountFraction = dayCountFraction }; var discounting = new Discounting { discountingType = discountingType, discountRateDayCountFraction = dayCountFraction }; calculation.discounting = discounting; calculation.Items = new object[] { FloatingRateCalculationHelper.CreateFloating(floatingRateIndex, tenor) }; return(calculation); }