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


C# IborIndex.forwardingTermStructure方法代碼示例

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


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

示例1: LiborForwardModelProcess

        public LiborForwardModelProcess(int size, IborIndex index, IDiscretization disc)
            : base(disc)
        {
            size_ = size;
            index_ = index;
            initialValues_ = new InitializedList<double>(size_);
            fixingTimes_ = new InitializedList<double>(size);
            fixingDates_ = new InitializedList<Date>(size_);
            accrualStartTimes_ = new InitializedList<double>(size);
            accrualEndTimes_ = new InitializedList<double>(size);
            accrualPeriod_ = new InitializedList<double>(size_);
            m1 = new Vector(size_);
            m2 = new Vector(size_);
            DayCounter dayCounter = index.dayCounter();
            IList<CashFlow> flows = cashFlows(1);

            if(!(size_ == flows.Count))
                    throw new ArgumentException( "wrong number of cashflows");

            Date settlement = index_.forwardingTermStructure().link.referenceDate();
            Date startDate;
            IborCoupon iborcoupon = (IborCoupon)flows[0];
            startDate = iborcoupon.fixingDate();

            for (int i = 0; i < size_; ++i)
            {
                IborCoupon coupon = (IborCoupon)flows[i];

                if(!(coupon.date() == coupon.accrualEndDate()))
                    throw new ArgumentException("irregular coupon types are not suppported");

                initialValues_[i]=coupon.rate();
                accrualPeriod_[i]=coupon.accrualPeriod();

                fixingDates_[i]=coupon.fixingDate();
                fixingTimes_[i]=dayCounter.yearFraction(startDate, coupon.fixingDate());
                accrualStartTimes_[i]=dayCounter.yearFraction(settlement, coupon.accrualStartDate());
                accrualEndTimes_[i]=dayCounter.yearFraction(settlement, coupon.accrualEndDate());
            }
        }
開發者ID:Yenyenx,項目名稱:qlnet,代碼行數:40,代碼來源:lfmprocess.cs

示例2: MakeVanillaSwap

        public MakeVanillaSwap(Period swapTenor, IborIndex index, double? fixedRate, Period forwardStart) {
            swapTenor_ = swapTenor;
            iborIndex_ = index;
            fixedRate_ = fixedRate;
            forwardStart_ = forwardStart;
            effectiveDate_ = null;
            fixedCalendar_ = floatCalendar_ = index.fixingCalendar();
            
            type_ = VanillaSwap.Type.Payer;
            nominal_ = 1.0;
            fixedTenor_ = new Period(1, TimeUnit.Years);
            floatTenor_ = index.tenor();
            fixedConvention_ = fixedTerminationDateConvention_ = BusinessDayConvention.ModifiedFollowing;
            floatConvention_ = floatTerminationDateConvention_ = index.businessDayConvention();
            fixedRule_ = floatRule_ = DateGeneration.Rule.Backward;
            fixedEndOfMonth_ = floatEndOfMonth_ = false;
            fixedFirstDate_ = fixedNextToLastDate_ = floatFirstDate_ = floatNextToLastDate_ = null;
            floatSpread_ = 0.0;
            fixedDayCount_ = new Thirty360(Thirty360.Thirty360Convention.BondBasis);
            floatDayCount_ = index.dayCounter();

            engine_ = new DiscountingSwapEngine(index.forwardingTermStructure());
        }
開發者ID:akasolace,項目名稱:qlnet,代碼行數:23,代碼來源:Makevanillaswap.cs

示例3: MakeBasisSwap

        public MakeBasisSwap(Period swapTenor, IborIndex index1, IborIndex index2, Period forwardStart)
        {
            swapTenor_ = swapTenor;
             iborIndex1_ = index1;
             iborIndex2_ = index2;
             forwardStart_ = forwardStart;
             effectiveDate_ = null;
             float1Calendar_ = float2Calendar_ = index1.fixingCalendar();

             type_ = BasisSwap.Type.Payer;
             nominal_ = 1.0;
             float1Tenor_ = index1.tenor();
             float2Tenor_ = index2.tenor();
             float1Convention_ = float1TerminationDateConvention_ = index1.businessDayConvention();
             float2Convention_ = float2TerminationDateConvention_ = index2.businessDayConvention();
             float1Rule_ = float2Rule_ = DateGeneration.Rule.Backward;
             float1EndOfMonth_ = float2EndOfMonth_ = false;
             float1FirstDate_ = float1NextToLastDate_ = float2FirstDate_ = float2NextToLastDate_ = null;
             float1Spread_ = float2Spread_ = 0.0;
             float1DayCount_ = index1.dayCounter();
             float2DayCount_ = index2.dayCounter();

             engine_ = new DiscountingBasisSwapEngine(index1.forwardingTermStructure(), index2.forwardingTermStructure());
        }
開發者ID:Yenyenx,項目名稱:qlnet,代碼行數:24,代碼來源:MakeBasisSwap.cs


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