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