문제

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