本文整理匯總了C#中QLNet.IborIndex.endOfMonth方法的典型用法代碼示例。如果您正苦於以下問題:C# IborIndex.endOfMonth方法的具體用法?C# IborIndex.endOfMonth怎麽用?C# IborIndex.endOfMonth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QLNet.IborIndex
的用法示例。
在下文中一共展示了IborIndex.endOfMonth方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DepositRateHelper
public DepositRateHelper(double rate, IborIndex i)
: base(rate)
{
iborIndex_ = new IborIndex("no-fix", // never take fixing into account
i.tenor(), i.fixingDays(), new Currency(),
i.fixingCalendar(), i.businessDayConvention(),
i.endOfMonth(), i.dayCounter(), termStructureHandle_);
initializeDates();
}
示例2: FRARateHelper
public FRARateHelper(double rate, int monthsToStart, IborIndex i)
: base(rate)
{
periodToStart_ = new Period(monthsToStart, TimeUnit.Months);
iborIndex_ = new IborIndex("no-fix", // never take fixing into account
i.tenor(), i.fixingDays(), new Currency(),
i.fixingCalendar(), i.businessDayConvention(),
i.endOfMonth(), i.dayCounter(), termStructureHandle_);
initializeDates();
}
示例3: CapHelper
public CapHelper(Period length,
Handle<Quote> volatility,
IborIndex index,
// data for ATM swap-rate calculation
Frequency fixedLegFrequency,
DayCounter fixedLegDayCounter,
bool includeFirstSwaplet,
Handle<YieldTermStructure> termStructure,
bool calibrateVolatility /*= false*/)
: base(volatility, termStructure, calibrateVolatility)
{
Period indexTenor = index.tenor();
double fixedRate = 0.04; // dummy value
Date startDate, maturity;
if (includeFirstSwaplet) {
startDate = termStructure.link.referenceDate();
maturity = termStructure.link.referenceDate() + length;
} else {
startDate = termStructure.link.referenceDate() + indexTenor;
maturity = termStructure.link.referenceDate() + length;
}
IborIndex dummyIndex=new
IborIndex("dummy",
indexTenor,
index.fixingDays(),
index.currency(),
index.fixingCalendar(),
index.businessDayConvention(),
index.endOfMonth(),
termStructure.link.dayCounter(),
termStructure);
List<double> nominals = new InitializedList<double>(1,1.0);
Schedule floatSchedule=new Schedule(startDate, maturity,
index.tenor(), index.fixingCalendar(),
index.businessDayConvention(),
index.businessDayConvention(),
DateGeneration.Rule.Forward, false);
List<CashFlow> floatingLeg;
IborLeg iborLeg = (IborLeg) new IborLeg(floatSchedule, index)
.withFixingDays(0)
.withNotionals(nominals)
.withPaymentAdjustment(index.businessDayConvention());
floatingLeg = iborLeg.value();
Schedule fixedSchedule=new Schedule(startDate, maturity, new Period(fixedLegFrequency),
index.fixingCalendar(),
BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted,
DateGeneration.Rule.Forward, false);
List<CashFlow> fixedLeg = new FixedRateLeg(fixedSchedule)
.withCouponRates(fixedRate, fixedLegDayCounter)
.withNotionals(nominals)
.withPaymentAdjustment(index.businessDayConvention());
Swap swap = new Swap(floatingLeg, fixedLeg);
swap.setPricingEngine(new DiscountingSwapEngine(termStructure));
double bp = 1.0e-4;
double fairRate = fixedRate - (double)(swap.NPV()/(swap.legBPS(1) / bp));
List<double> exerciceRate = new InitializedList<double>(1,fairRate);
cap_ = new Cap(floatingLeg, exerciceRate);
marketValue_ = blackPrice(volatility_.link.value());
}