With the QuantLib C++ library, I'm trying to evaluate bonds which have different coupons during their lifetime (for example 6% for the first three years, then 4% for the remaining three years).

I noticed that the constructor of the FixedRateBond class accepts a vector of coupons: const std::vector< Rate > &coupons:

FixedRateBond (Natural settlementDays,
Real faceAmount,
const Schedule &schedule,
const std::vector< Rate > &coupons,
const DayCounter &accrualDayCounter,
BusinessDayConvention paymentConvention=Following,
Real redemption=100.0,
const Date &issueDate=Date(),
const Calendar &paymentCalendar=Calendar())

That seems to be useful for my purpose, but how can I specify at which dates each coupon starts to apply?

有帮助吗?

解决方案

Just count the coupons. If your bond pays annual coupons, you'll have three coupon in the first three years and three afterwards. In that case, pass (0.06, 0.06, 0.06, 0.04, 0.04, 0.04) as the vector of coupon rates. If the coupons are semiannual, there are six of them in three years; in that case, pass a vector containing 0.06 six times and 0.04 another six times. You get the idea: pass the rate for each coupon.

其他提示

At a wild stab in the dark, the schedule sounds likely.
This takes a vector of dates. See the docs

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top