當前位置: 首頁>>代碼示例>>C#>>正文


C# Schedule.endDate方法代碼示例

本文整理匯總了C#中QLNet.Schedule.endDate方法的典型用法代碼示例。如果您正苦於以下問題:C# Schedule.endDate方法的具體用法?C# Schedule.endDate怎麽用?C# Schedule.endDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在QLNet.Schedule的用法示例。


在下文中一共展示了Schedule.endDate方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FixedRateBond

      //! fixed-rate bond
      /*! \ingroup instruments

          \test calculations are tested by checking results against
                cached values.
      */
 

      //! simple annual compounding coupon rates      
      public FixedRateBond(int settlementDays, double faceAmount, Schedule schedule,List<double> coupons, 
                           DayCounter accrualDayCounter, BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
                           double redemption = 100, Date issueDate = null,Calendar paymentCalendar = null,
			                  Period exCouponPeriod = null,
                           Calendar exCouponCalendar = null,
									BusinessDayConvention exCouponConvention = BusinessDayConvention.Unadjusted,
                           bool exCouponEndOfMonth = false)
         : base(settlementDays, paymentCalendar == null ? schedule.calendar() : paymentCalendar, 
                issueDate) 
      {
         frequency_ = schedule.tenor().frequency();
         dayCounter_ = accrualDayCounter;
         maturityDate_ = schedule.endDate();

         cashflows_ = new FixedRateLeg(schedule)
            .withCouponRates(coupons, accrualDayCounter)
				.withExCouponPeriod(exCouponPeriod,
										  exCouponCalendar,
										  exCouponConvention,
										  exCouponEndOfMonth)
            .withPaymentCalendar(calendar_)
            .withNotionals(faceAmount)
            .withPaymentAdjustment(paymentConvention); 

         addRedemptionsToCashflows(new List<double>() { redemption });

         if (cashflows().Count == 0)
            throw new ApplicationException("bond with no cashflows!");

         if (redemptions_.Count != 1)
            throw new ApplicationException("multiple redemptions created");
      }
開發者ID:akasolace,項目名稱:qlnet,代碼行數:41,代碼來源:Fixedratebond.cs

示例2: FloatingRateBond

        public FloatingRateBond(int settlementDays, double faceAmount, Schedule schedule, IborIndex index, DayCounter paymentDayCounter,
                                BusinessDayConvention paymentConvention, int fixingDays, List<double> gearings, List<double> spreads,
                                List<double> caps, List<double> floors, bool inArrears, double redemption, Date issueDate)
            : base(settlementDays, schedule.calendar(), issueDate) {
            maturityDate_ = schedule.endDate();
            cashflows_ = new IborLeg(schedule, index)
                            .withPaymentDayCounter(paymentDayCounter)
                            .withFixingDays(fixingDays)
                            .withGearings(gearings)
                            .withSpreads(spreads)
                            .withCaps(caps)
                            .withFloors(floors)
                            .inArrears(inArrears)
                            .withNotionals(faceAmount)
                            .withPaymentAdjustment(paymentConvention);

            addRedemptionsToCashflows(new List<double>() { redemption });

            if (cashflows().Count == 0)
                throw new ApplicationException("bond with no cashflows!");
            if (redemptions_.Count != 1)
                throw new ApplicationException("multiple redemptions created");

            index.registerWith(update);
        }
開發者ID:akasolace,項目名稱:qlnet,代碼行數:25,代碼來源:FloatingRateBond.cs

示例3: AmortizingFixedRateBond

      public AmortizingFixedRateBond(
                          int settlementDays,
                          List<double> notionals,
                          Schedule schedule,
                          List<double> coupons,
                          DayCounter accrualDayCounter,
                          BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
                          Date issueDate = null)
         :base(settlementDays, schedule.calendar(), issueDate)
      {
         frequency_ = schedule.tenor().frequency();
         dayCounter_ = accrualDayCounter;
         schedule_ = schedule;

         maturityDate_ = schedule.endDate();

         cashflows_ = new FixedRateLeg(schedule)
             .withCouponRates(coupons, accrualDayCounter)
             .withNotionals(notionals)
             .withPaymentAdjustment(paymentConvention).value();
             

         addRedemptionsToCashflows();

         if ( cashflows().empty())
            throw new ApplicationException("bond with no cashflows!");
      }
開發者ID:akasolace,項目名稱:qlnet,代碼行數:27,代碼來源:AmortizingFixedRateBond.cs

示例4: ConvertibleBond

        protected ConvertibleBond( Exercise exercise,
                                 double conversionRatio,
                                 DividendSchedule dividends,
                                 CallabilitySchedule callability,
                                 Handle<Quote> creditSpread,
                                 Date issueDate,
                                 int settlementDays,
                                 Schedule schedule,
                                 double redemption)
            : base(settlementDays, schedule.calendar(), issueDate)
        {
            conversionRatio_ = conversionRatio;
             callability_ = callability;
             dividends_ = dividends;
             creditSpread_ = creditSpread;

             maturityDate_ = schedule.endDate();

             if (!callability.empty())
             {
            Utils.QL_REQUIRE( callability.Last().date() <= maturityDate_, () =>
                              "last callability date ("
                              + callability.Last().date()
                              + ") later than maturity ("
                              + maturityDate_.ToShortDateString() + ")");
            }

             creditSpread.registerWith(update);
        }
開發者ID:Yenyenx,項目名稱:qlnet,代碼行數:29,代碼來源:ConvertibleBond.cs

示例5: CPIBond

        public CPIBond(int settlementDays,
                double faceAmount,
                bool growthOnly,
                double baseCPI,
                Period observationLag,
                ZeroInflationIndex cpiIndex,
                InterpolationType observationInterpolation,
                Schedule schedule,
                List<double> fixedRate,
                DayCounter accrualDayCounter,
                BusinessDayConvention paymentConvention = BusinessDayConvention.ModifiedFollowing,
                Date issueDate = null,
                Calendar paymentCalendar = null,
                Period exCouponPeriod = null,
                Calendar exCouponCalendar = null,
					 BusinessDayConvention exCouponConvention = BusinessDayConvention.Unadjusted,
                bool exCouponEndOfMonth = false)                
            :base(settlementDays, paymentCalendar == null ? schedule.calendar() : paymentCalendar, issueDate)
        {
            frequency_ = schedule.tenor().frequency();
            dayCounter_ = accrualDayCounter;
            growthOnly_ = growthOnly;
            baseCPI_=baseCPI;
            observationLag_ = observationLag;
            cpiIndex_= cpiIndex;
            observationInterpolation_ = observationInterpolation;

            maturityDate_ = schedule.endDate();

            // a CPIleg know about zero legs and inclusion of base inflation notional
            cashflows_ = new CPILeg(schedule, cpiIndex_,
                                    baseCPI_, observationLag_)
             .withSubtractInflationNominal(growthOnly_)
             .withObservationInterpolation(observationInterpolation_)
             .withPaymentDayCounter(accrualDayCounter)
             .withFixedRates(fixedRate)
             .withPaymentCalendar(calendar_)
             .withExCouponPeriod(exCouponPeriod,
                                exCouponCalendar,
                                exCouponConvention,
                                exCouponEndOfMonth)
             .withNotionals(faceAmount)
             .withPaymentAdjustment(paymentConvention);
            

            calculateNotionalsFromCashflows();

            cpiIndex_.registerWith(update);

            foreach ( CashFlow i in cashflows_) 
                i.registerWith(update);
        }
開發者ID:minikie,項目名稱:test,代碼行數:52,代碼來源:CPIBond.cs

示例6: AmortizingFloatingRateBond

      public AmortizingFloatingRateBond(int settlementDays,
                                        List<double> notionals,
                                        Schedule schedule,
                                        IborIndex index,
                                        DayCounter accrualDayCounter,
                                        BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
                                        int fixingDays = 0,
                                        List<double> gearings = null,
                                        List<double> spreads = null,
                                        List<double> caps = null,
                                        List<double> floors = null,
                                        bool inArrears = false,
                                        Date issueDate = null)
         :base(settlementDays, schedule.calendar(), issueDate)
      {
         if ( gearings == null ) 
            gearings = new List<double>() {1, 1.0};

         if (spreads == null)
            spreads = new List<double>() { 1, 0.0 };

         if (caps == null)
            caps = new List<double>() ;

         if (floors == null)
            floors = new List<double>();

         maturityDate_ = schedule.endDate();


         cashflows_ = new IborLeg(schedule, index)
                         .withCaps(caps)
                         .withFloors(floors)
                         .inArrears(inArrears)
                         .withSpreads(spreads)
                         .withGearings(gearings)
                         .withFixingDays(fixingDays)
                         .withPaymentDayCounter(accrualDayCounter)
                         .withPaymentAdjustment(paymentConvention)
                         .withNotionals(notionals).value();

         addRedemptionsToCashflows();

         Utils.QL_REQUIRE( !cashflows().empty(), () => "bond with no cashflows!" );

         index.registerWith(update);

      }
開發者ID:minikie,項目名稱:test,代碼行數:48,代碼來源:AmortizingFloatingRateBond.cs

示例7: CmsRateBond

         public CmsRateBond(int settlementDays,
                            double faceAmount,
                            Schedule schedule,
                            SwapIndex index,
                            DayCounter paymentDayCounter,
                            BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
                            int fixingDays = 0,
                            List<double> gearings = null,
                            List<double> spreads = null,
                            List<double> caps = null,
                            List<double> floors = null,
                            bool inArrears = false,
                            double redemption = 100.0,
                            Date issueDate = null)
             : base(settlementDays, schedule.calendar(), issueDate) 
         {
             // Optional value check
             if ( gearings == null ) gearings = new List<double>(){1};
             if ( spreads == null ) spreads = new List<double>(){0};
             if (caps == null) caps = new List<double>();
             if (floors == null) floors = new List<double>();

             maturityDate_ = schedule.endDate();
             cashflows_ = new CmsLeg(schedule, index)
                            .withPaymentDayCounter(paymentDayCounter)
                            .withFixingDays(fixingDays)
                            .withGearings(gearings)
                            .withSpreads(spreads)
                            .withCaps(caps)
                            .withFloors(floors)
                            .inArrears(inArrears)
                            .withNotionals(faceAmount)
                            .withPaymentAdjustment(paymentConvention); 
              
             addRedemptionsToCashflows(new List<double>() { redemption });

             if (cashflows().Count == 0)
                throw new ApplicationException("bond with no cashflows!");
             if (redemptions_.Count != 1)
                throw new ApplicationException("multiple redemptions created");

             index.registerWith(update);

        
        }
開發者ID:akasolace,項目名稱:qlnet,代碼行數:45,代碼來源:CmsRateBond.cs

示例8: FixedRateBond

      //! simple annual compounding coupon rates      
      public FixedRateBond(int settlementDays, double faceAmount, Schedule schedule,List<double> coupons, 
                           DayCounter accrualDayCounter, BusinessDayConvention paymentConvention,
                           double redemption, Date issueDate,Calendar paymentCalendar)
         : base(settlementDays, paymentCalendar == new Calendar() ? schedule.calendar() : paymentCalendar, 
                issueDate) 
      {
         frequency_ = schedule.tenor().frequency();
         dayCounter_ = accrualDayCounter;
         maturityDate_ = schedule.endDate();

         cashflows_ = new FixedRateLeg(schedule)
            .withCouponRates(coupons, accrualDayCounter)
            .withPaymentCalendar(calendar_)
            .withNotionals(faceAmount)
            .withPaymentAdjustment(paymentConvention);

         addRedemptionsToCashflows(new List<double>() { redemption });

         if (cashflows().Count == 0)
            throw new ApplicationException("bond with no cashflows!");

         if (redemptions_.Count != 1)
            throw new ApplicationException("multiple redemptions created");
      }
開發者ID:minikie,項目名稱:OTCDerivativesCalculatorModule,代碼行數:25,代碼來源:Fixedratebond.cs


注:本文中的QLNet.Schedule.endDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。