|
From: Dagur G. <da...@ko...> - 2023-05-19 14:26:42
|
Thank you for your reply,
I still get an error due to the increasing notionals
terminate called after throwing an instance of 'QuantLib::Error'
what(): increasing coupon notionals
Aborted (core dumped)
I use the bond = new Bond(0, calendar_, interestFromDate_, coupons);
Where coupons is QuantLib::Leg coupons; and the coupons added as in the
pseudo-code example.
regards
Dagur G
On Thu, Apr 27, 2023 at 3:42 PM Luigi Ballabio <lui...@gm...>
wrote:
> For a fixed-rate bullet bond, I'd try building the coupons manually, as in
> (pseudo-code, not tested, take with a grain of salt):
>
> Leg coupons;
> coupons.push_back(ext::make_shared<FixedRateCoupon>(date[0], 100,
> ...));
> for (each other coupon) {
> const auto& last = coupons.back();
> coupons.push_back(ext::make_shared<FixedRateCoupon>(date[1],
> last->nominal() + last->amount(), ...)
> }
>
> once you have all of them, you can pass them to the proper Bond
> constructor:
>
> auto bond = ext::make_shared<Bond>(settlementDays, calendar,
> issueDate, coupons);
>
> Due to the increasing notionals, the constructor will add negative
> payments at each coupon date that represent adding amount to the notional
> and will cancel out the coupon payments.
>
> Let me know if this works for you.
>
> Luigi
>
>
>
> On Mon, Apr 17, 2023 at 5:20 PM Dagur Gunnarsson <da...@ko...> wrote:
>
>> Hello,
>>
>> Is there any way to define a BulletLoan, Bond in QuantLib such that the
>> coupon payments add to the notional each period?
>>
>> First the notional is 100.0
>> then 103.5 .etc. until maturity.
>>
>> -Dagur
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|