本文整理匯總了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());
}
}
示例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());
}
示例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());
}