/// <summary>
        ///
        /// </summary>
        /// <param name="uniqueId"></param>
        /// <param name="payerIsBase"></param>
        /// <param name="accrualStartDate"></param>
        /// <param name="accrualEndDate"></param>
        /// <param name="adjustCalculationDatesIndicator"></param>
        /// <param name="paymentDate"></param>
        /// <param name="notionalAmount"></param>
        /// <param name="resetRelativeTo"></param>
        /// <param name="fixingDateRelativeOffset"></param>
        /// <param name="margin"></param>
        /// <param name="baseRate"> </param>
        /// <param name="calculation"></param>
        /// <param name="forecastRateIndex"></param>
        /// <param name="fixingCalendar"></param>
        /// <param name="paymentCalendar"></param>
        public PriceableFloatingRateCoupon
            (string uniqueId
            , bool payerIsBase
            , DateTime accrualStartDate
            , DateTime accrualEndDate
            , Boolean adjustCalculationDatesIndicator
            , AdjustableOrAdjustedDate paymentDate
            , Money notionalAmount
            , ResetRelativeToEnum resetRelativeTo
            , RelativeDateOffset fixingDateRelativeOffset
            , Decimal margin
            , Decimal baseRate
            , Calculation calculation
            , ForecastRateIndex forecastRateIndex
            , IBusinessCalendar fixingCalendar
            , IBusinessCalendar paymentCalendar)
            : base
                (uniqueId
                , CouponType.FloatingRate
                , payerIsBase
                , accrualStartDate
                , accrualEndDate
                , adjustCalculationDatesIndicator
                , BusinessDayAdjustmentsHelper.Create(fixingDateRelativeOffset.businessDayConvention, fixingDateRelativeOffset.businessCenters)
                , calculation
                , notionalAmount
                , paymentDate
                , paymentCalendar)
        {
            BaseRate                 = baseRate;
            FixingCalendar           = fixingCalendar;
            ModelIdentifier          = "DualCurveCouponModel";
            ForwardStartDate         = AccrualStartDate;
            ForwardEndDate           = AccrualEndDate;
            ForecastRateIndex        = forecastRateIndex;
            FixingDateRelativeOffset = fixingDateRelativeOffset;
            ResetRelativeTo          = resetRelativeTo;
            Margin = margin;
            var floatingRateDefinition = (FloatingRateDefinition)calculation.Items[0];

            RateObservation    = floatingRateDefinition.rateObservation[0];
            AdjustedFixingDate = GetResetDate(resetRelativeTo, fixingDateRelativeOffset);
            SetRateObservation(RateObservation, ResetDate);
            ForecastCurveName = CurveNameHelpers.GetForecastCurveName(forecastRateIndex);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableFxRateCashflow"/> class.
 /// </summary>
 /// <param name="cashlfowId">The stream id.</param>
 /// <param name="payerIsBase">The payer is base flag.</param>
 /// <param name="accrualStartDate">The accrual start date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="accrualEndDate">The accrual end date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="margin">The margin.</param>
 /// <param name="baseRate">The base rate for a nettable fixed/floating cash flow. </param>
 /// <param name="observedRate">The observed Rate. If this is not null, then it is used.</param>
 /// <param name="notionalAmount">The notional amount.</param>
 /// <param name="adjustedFixingDate">The adjusted fixing date.</param>
 /// <param name="dayCountfraction">Type of day Countfraction.</param>
 /// <param name="paymentDate">The payment date.</param>
 /// <param name="forecastRateIndex">The forecastrate index.</param>
 /// <param name="discountingType">The swap discounting type.</param>
 /// <param name="discountRate">The discount rate.</param>
 /// <param name="fraDiscounting">Determines whether the coupon is discounted or not. If this parameter is null,
 /// then it is assumed that there is no fradiscounting</param>
 /// <param name="fixingCalendar">The fixingCalendar.</param>
 /// <param name="paymentCalendar">The paymentCalendar.</param>
 public PriceableFloatingRateCoupon
 (
     string cashlfowId
     , bool payerIsBase
     , DateTime accrualStartDate
     , DateTime accrualEndDate
     , DateTime adjustedFixingDate
     , DayCountFraction dayCountfraction
     , Decimal margin
     , Decimal baseRate
     , Decimal?observedRate
     , Money notionalAmount
     , DateTime paymentDate
     , ForecastRateIndex forecastRateIndex
     , DiscountingTypeEnum?discountingType
     , Decimal?discountRate
     , FraDiscountingEnum?fraDiscounting
     , IBusinessCalendar fixingCalendar
     , IBusinessCalendar paymentCalendar)
     : base(
         cashlfowId
         , CouponType.FloatingRate
         , payerIsBase
         , accrualStartDate
         , accrualEndDate
         , notionalAmount
         , dayCountfraction
         , observedRate
         , paymentDate
         , discountingType
         , discountRate
         , fraDiscounting
         , paymentCalendar)
 {
     BaseRate        = baseRate;
     FixingCalendar  = fixingCalendar;
     ModelIdentifier = "DualCurveCouponModel";
     Id = cashlfowId;
     ForecastRateIndex  = forecastRateIndex;
     Margin             = margin;
     AdjustedFixingDate = adjustedFixingDate;
     RateObservation    = RateObservationHelper.Parse(AdjustedFixingDate, observedRate, "1");
     SetRateObservation(RateObservation, ResetDate);
     ForecastCurveName = CurveNameHelpers.GetForecastCurveName(forecastRateIndex);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableRateCoupon"/> class.
 /// This is only used for Xibor type structured coupons with convexity adjustments and only
 /// in the same currency i.e. there is no quanto effects.
 /// </summary>
 /// <param name="cashlfowId">The stream id.</param>
 /// <param name="accrualStartDate">The accrual start date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="accrualEndDate">The accrual end date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="calculationDayCountFraction">The daycountfraction used for the calculation period i.e. the index calculation.</param>
 /// <param name="margin">The margin.</param>
 /// <param name="observedRate">The observed Rate. If this is not null, then it is used.</param>
 /// <param name="notionalAmount">The notional amount.</param>
 /// <param name="adjustedFixingDate">The adjusted fixing date.</param>
 /// <param name="calculationStartDate">The calculation start date.</param>
 /// <param name="calculationEndDate">The calculation end date.</param>
 /// <param name="accrualDayCountfraction">Type of dayCountfraction use for the the accrual period.</param>
 /// <param name="paymentDate">The payment date.</param>
 /// <param name="forecastRateIndex">The forecastrateindex.</param>
 /// <param name="discountingType">The swap discounting type.</param>
 /// <param name="discountRate">The discount rate.</param>
 /// <param name="fraDiscounting">Determines whether the coupon is discounted or not. If this parameter is null,
 /// <param name="calculationStartDate"></param>
 /// then it is assumed that there is no fradiscounting</param>
 public PriceableStructuredRateCoupon
 (
     string cashlfowId
     , DateTime accrualStartDate
     , DateTime accrualEndDate
     , DateTime adjustedFixingDate
     , DateTime calculationStartDate
     , DateTime calculationEndDate
     , DayCountFraction accrualDayCountfraction
     , DayCountFraction calculationDayCountFraction
     , Decimal margin
     , Decimal?observedRate
     , Money notionalAmount
     , DateTime paymentDate
     , ForecastRateIndex forecastRateIndex
     , DiscountingTypeEnum?discountingType
     , Decimal?discountRate
     , FraDiscountingEnum?fraDiscounting)
     : base(
         cashlfowId
         , accrualStartDate
         , accrualEndDate
         , adjustedFixingDate
         , accrualDayCountfraction
         , margin
         , observedRate
         , notionalAmount
         , paymentDate
         , forecastRateIndex
         , discountingType
         , discountRate
         , fraDiscounting
         )
 {
     CalculationStartDate        = calculationStartDate;
     CalculationEndDate          = calculationEndDate;
     CalculationDayCountFraction = calculationDayCountFraction;
     PriceableCouponType         = CouponType.StructuredRate;
     AnalyticsModel = new StructuredRateCouponAnalytic();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableFxRateCashflow"/> class.
 /// </summary>
 /// <param name="cashlfowId">The stream id.</param>
 /// <param name="payerIsBase">The payer is base flag.</param>
 /// <param name="accrualStartDate">The accrual start date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="accrualEndDate">The accrual end date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="margin">The margin.</param>
 /// <param name="observedRate">The observed Rate. If this is not null, then it is used.</param>
 /// <param name="notionalAmount">The notional amount.</param>
 /// <param name="adjustedFixingDate">The adjusted fixing date.</param>
 /// <param name="dayCountfraction">Type of day Countfraction.</param>
 /// <param name="paymentDate">The payment date.</param>
 /// <param name="forecastRateIndex">The forecastrate index.</param>
 /// <param name="discountingType">The swap discounting type.</param>
 /// <param name="discountRate">The discount rate.</param>
 /// <param name="fraDiscounting">Determines whether the coupon is discounted or not. If this parameter is null,
 /// then it is assumed that there is no fradiscounting</param>
 /// <param name="fixingCalendar">The fixingCalendar.</param>
 /// <param name="paymentCalendar">The paymentCalendar.</param>
 public PriceableFloatingRateCoupon
 (
     string cashlfowId
     , bool payerIsBase
     , DateTime accrualStartDate
     , DateTime accrualEndDate
     , DateTime adjustedFixingDate
     , DayCountFraction dayCountfraction
     , Decimal margin
     , Decimal?observedRate
     , Money notionalAmount
     , DateTime paymentDate
     , ForecastRateIndex forecastRateIndex
     , DiscountingTypeEnum?discountingType
     , Decimal?discountRate
     , FraDiscountingEnum?fraDiscounting
     , IBusinessCalendar fixingCalendar
     , IBusinessCalendar paymentCalendar)
     : this(
         cashlfowId
         , payerIsBase
         , accrualStartDate
         , accrualEndDate
         , adjustedFixingDate
         , dayCountfraction
         , margin
         , 0.0m
         , observedRate
         , notionalAmount
         , paymentDate
         , forecastRateIndex
         , discountingType
         , discountRate
         , fraDiscounting
         , fixingCalendar
         , paymentCalendar)
 {
 }
Esempio n. 5
0
 ///<summary>
 /// Gets all the Vol surface curve name.
 ///</summary>
 ///<returns></returns>
 public static string GetRateVolatilityMatrixName(ForecastRateIndex forecastRateIndex)
 {
     return(GetForecastCurveName(PricingStructureTypeEnum.RateVolatilityMatrix, forecastRateIndex));
 }
Esempio n. 6
0
 ///<summary>
 /// Gets all the Forecast curve name.
 ///</summary>
 ///<returns></returns>
 private static string GetForecastCurveName(PricingStructureTypeEnum curveType, ForecastRateIndex floatingRateIndex)
 {
     return(curveType + "." + floatingRateIndex.floatingRateIndex.Value + "-" + floatingRateIndex.indexTenor.ToString());
 }
Esempio n. 7
0
 ///<summary>
 /// Gets all the forecast curve name.
 ///</summary>
 ///<returns></returns>
 public static string GetForecastCurveName(ForecastRateIndex forecastRateIndex)
 {
     return(GetForecastCurveName(PricingStructureTypeEnum.RateCurve, forecastRateIndex));
 }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableCapFloorCoupon"/> class.
 /// </summary>
 /// <param name="cashFlowId">The stream id.</param>
 /// <param name="buyerIsBase">The buyer is base flag.</param>
 /// <param name="capStrike">The Cap strike.</param>
 /// <param name="floorStrike">The floor strike.</param>
 /// <param name="accrualStartDate">The accrual start date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="accrualEndDate">The accrual end date. If adjusted, the adjustCalculationDatesIndicator should be false.</param>
 /// <param name="adjustAccrualDatesIndicator">if set to <c>true</c> [adjust calculation dates indicator].</param>
 /// <param name="accrualBusinessCenters">The accrual business centers.</param>
 /// <param name="margin">The margin.</param>
 /// <param name="observedRate">The observed Rate.</param>
 /// <param name="notionalAmount">The notional amount.</param>
 /// <param name="dayCountFraction">Type of day Count fraction.</param>
 /// <param name="paymentDate">The payment date.</param>
 /// <param name="accrualRollConvention">The accrual roll convention.</param>
 /// <param name="resetRelativeTo">reset relative to?</param>
 /// <param name="fixingDateRelativeOffset">The fixing date offset.</param>
 /// <param name="forecastRateIndex">The forecast rate index.</param>
 /// <param name="discountingType">The swap discounting type.</param>
 /// <param name="discountRate">The discount rate.</param>
 /// <param name="fraDiscounting">Determines whether the coupon is discounted or not. If this parameter is null,
 /// then it is assumed that there is no fra discounting</param>
 /// <param name="fixingCalendar">The fixingCalendar.</param>
 /// <param name="paymentCalendar">The paymentCalendar.</param>
 public PriceableCapFloorCoupon
 (
     string cashFlowId
     , bool buyerIsBase
     , decimal?capStrike
     , decimal?floorStrike
     , DateTime accrualStartDate
     , DateTime accrualEndDate
     , Boolean adjustAccrualDatesIndicator
     , BusinessCenters accrualBusinessCenters
     , BusinessDayConventionEnum accrualRollConvention
     , DayCountFraction dayCountFraction
     , ResetRelativeToEnum resetRelativeTo
     , RelativeDateOffset fixingDateRelativeOffset
     , Decimal margin
     , Decimal?observedRate
     , Money notionalAmount
     , AdjustableOrAdjustedDate paymentDate
     , ForecastRateIndex forecastRateIndex
     , DiscountingTypeEnum?discountingType
     , Decimal?discountRate
     , FraDiscountingEnum?fraDiscounting
     , IBusinessCalendar fixingCalendar
     , IBusinessCalendar paymentCalendar)
     : base(
         cashFlowId
         , buyerIsBase
         , accrualStartDate
         , accrualEndDate
         , adjustAccrualDatesIndicator
         , accrualBusinessCenters
         , accrualRollConvention
         , dayCountFraction
         , resetRelativeTo
         , fixingDateRelativeOffset
         , margin
         , observedRate
         , notionalAmount
         , paymentDate
         , forecastRateIndex
         , discountingType
         , discountRate
         , fraDiscounting
         , fixingCalendar
         , paymentCalendar)
 {
     CapStrike             = capStrike;
     FloorStrike           = floorStrike;
     VolatilitySurfaceName = CurveNameHelpers.GetRateVolatilityMatrixName(forecastRateIndex);
     if (capStrike != null && floorStrike == null)
     {
         PriceableCouponType = CouponType.Cap;
         ModelIdentifier     = "DualCurveCapModel";
         IsCall = true;
     }
     if (floorStrike != null && capStrike == null)
     {
         PriceableCouponType = CouponType.Floor;
         ModelIdentifier     = "DualCurveFloorModel";
     }
     if (floorStrike != null && capStrike != null)
     {
         PriceableCouponType = CouponType.Collar;
         ModelIdentifier     = "DualCurveCollarModel";
     }
 }