コード例 #1
0
        ///// <summary>
        ///// Initializes a new instance of the <see cref="PriceableFxONRate"/> class.
        ///// </summary>
        ///// <param name="baseDate">The base date.</param>
        ///// <param name="spotDateOffset">The business day adjustments.</param>
        ///// <param name="fxRateAsset"></param>
        ///// <param name="fxForward">The forward points.</param>
        //public PriceableFxONRate(DateTime baseDate, RelativeDateOffset spotDateOffset, FxRateAsset fxRateAsset, BasicQuotation fxForward)
        //    : this(1.0m, baseDate, fxRateAsset,
        //           spotDateOffset, fxForward)
        //{}

        /// <summary>
        /// Initializes a new instance of the <see cref="PriceableFxONRate"/> class.
        /// </summary>
        /// <param name="notionalAmount">The notional.</param>
        /// <param name="baseDate">The base date.</param>
        /// <param name="nodeStruct">The nodeStruct.</param>
        /// <param name="fxRateAsset">The asset itself</param>
        /// <param name="fixingCalendar">The fixing Calendar.</param>
        /// <param name="paymentCalendar">The payment Calendar.</param>
        /// <param name="fxForward">The forward points.</param>
        public PriceableFxONRate(DateTime baseDate, decimal notionalAmount, FxSpotNodeStruct nodeStruct,
                                 FxRateAsset fxRateAsset, IBusinessCalendar fixingCalendar, IBusinessCalendar paymentCalendar, BasicQuotation fxForward)
            : base(baseDate, "1D", notionalAmount, nodeStruct, fxRateAsset, fixingCalendar, paymentCalendar, fxForward)
        {
            AdjustedStartDate     = baseDate;
            AdjustedEffectiveDate = baseDate;
            RiskMaturityDate      = baseDate; //fixingCalendar.Advance(AdjustedStartDate, OffsetHelper.FromInterval(Tenor, DayTypeEnum.Business), SpotDateOffset.businessDayConvention); //baseDate;// GetForwardDate();
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableFxSpotRate"/> class.
 /// </summary>
 /// <param name="notionalAmount">The notional.</param>
 /// <param name="baseDate">The base date.</param>
 /// <param name="nodeStruct">The nodeStruct.</param>
 /// <param name="fxRateAsset">The asset itself</param>
 /// <param name="fixingCalendar">The fixing Calendar.</param>
 /// <param name="paymentCalendar">The payment Calendar.</param>
 /// <param name="fxForward">The forward points.</param>
 public PriceableFxSpotRate(DateTime baseDate, decimal notionalAmount, FxSpotNodeStruct nodeStruct,
                            FxRateAsset fxRateAsset, IBusinessCalendar fixingCalendar, IBusinessCalendar paymentCalendar, BasicQuotation fxForward)
     : base(baseDate, "2D", notionalAmount, nodeStruct, fxRateAsset, fixingCalendar, paymentCalendar, fxForward)
 {
     AdjustedStartDate     = baseDate;//GetSpotDate();
     AdjustedEffectiveDate = AdjustedStartDate;
     RiskMaturityDate      = GetSpotDate(AdjustedStartDate, fixingCalendar, nodeStruct.SpotDate);
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PriceableFxSpotRate"/> class.
 /// </summary>
 /// <param name="notionalAmount">The notional.</param>
 /// <param name="baseDate">The base date.</param>
 /// <param name="tenor">The tenor.</param>
 /// <param name="nodeStruct">The nodeStruct.</param>
 /// <param name="fxRateAsset">The asset itself</param>
 /// <param name="fixingCalendar">The fixing Calendar.</param>
 /// <param name="paymentCalendar">The payment Calendar.</param>
 /// <param name="fxForward">The forward points.</param>
 public PriceableFxForwardRate(DateTime baseDate, string tenor, decimal notionalAmount, FxSpotNodeStruct nodeStruct,
                               FxRateAsset fxRateAsset, IBusinessCalendar fixingCalendar, IBusinessCalendar paymentCalendar, BasicQuotation fxForward)
 {
     PaymentDiscountFactorCcy12 = 1.0m;
     PaymentDiscountFactorCcy1  = 1.0m;
     Ccy2CurveName   = string.Empty;
     Ccy1CurveName   = string.Empty;
     ModelIdentifier = "SimpleFxRateAsset";
     Id                    = fxRateAsset.id;
     Tenor                 = PeriodHelper.Parse(tenor);
     NotionalAmount        = notionalAmount;
     FxRateAsset           = fxRateAsset;
     BaseDate              = baseDate;
     SpotDateOffset        = nodeStruct.SpotDate;
     AdjustedStartDate     = GetSpotDate(baseDate, fixingCalendar, nodeStruct.SpotDate);//GetSpotDate();
     AdjustedEffectiveDate = AdjustedStartDate;
     RiskMaturityDate      = GetEffectiveDate(AdjustedStartDate, paymentCalendar, Tenor, nodeStruct.SpotDate.businessDayConvention);
     SetRate(fxForward);
 }