|
From: Dagur G. <da...@ko...> - 2012-01-06 22:52:49
|
hello, Is there a simple way to simulate a bond(fixed rate) that pays a single coupon on the maturity day as well as the principal, in QuantLib. I have tried to create a Fixed rate bond that has the FirstCouponDate = MaturityDate = FirstInstallmentDate but then I get the error *std::exception: first date (March 10th, 2015) out of effective-termination date range [March 10th, 2003, March 10th, 2015)*... regards D.G. |
|
From: StephenWong <ste...@gm...> - 2012-01-09 22:59:46
|
Dagur Gunnarsson-2 wrote: > > hello, > > Is there a simple way to simulate a bond(fixed rate) that pays a single > coupon on the maturity day as well as the principal, in QuantLib. I have > tried to create a Fixed rate bond that has the FirstCouponDate = > MaturityDate = FirstInstallmentDate but then I get the error > *std::exception: > first date (March 10th, 2015) out of effective-termination date range > [March 10th, 2003, March 10th, 2015)*... > > regards > D.G. > > Looks like you can do this with a combination of a fixed rate bond with regular coupon (at least once a year), then subtract that with a series of fixed rate bonds with the same coupon but shorter duration + a series of zero coupon bonds with the same maturities as the series of fixed rate bonds except the original bond. The combination would be what you want. -- View this message in context: http://old.nabble.com/Fixed-rate-bond-tp33096297p33108010.html Sent from the quantlib-users mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2012-01-10 08:17:54
|
On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <ste...@gm...> wrote: > Dagur Gunnarsson-2 wrote: >> Is there a simple way to simulate a bond(fixed rate) that pays a single >> coupon on the maturity day as well as the principal > > Looks like you can do this with a combination of a fixed rate bond with > regular coupon (at least once a year), then subtract that with a series of > fixed rate bonds with the same coupon but shorter duration + a series of > zero coupon bonds with the same maturities as the series of fixed rate bonds > except the original bond. The combination would be what you want. Or you could just use a fixed rate bond with all coupons except the last paying a null rate, or you can create a schedule with null frequency. It depends on how the final payment accrues. Is the rate accrued over the whole duration of the bond, or just a subperiod? Luigi |
|
From: Dagur G. <da...@ko...> - 2012-01-14 18:29:27
|
Hello, The rate is accrued over the whole period, so in at the maturity date the bond pays a coupon for the whole livetime of the bond, and the principal. regards Dagur G On Tue, Jan 10, 2012 at 8:17 AM, Luigi Ballabio <lui...@gm...>wrote: > On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <ste...@gm...> > wrote: > > Dagur Gunnarsson-2 wrote: > >> Is there a simple way to simulate a bond(fixed rate) that pays a single > >> coupon on the maturity day as well as the principal > > > > Looks like you can do this with a combination of a fixed rate bond with > > regular coupon (at least once a year), then subtract that with a series > of > > fixed rate bonds with the same coupon but shorter duration + a series of > > zero coupon bonds with the same maturities as the series of fixed rate > bonds > > except the original bond. The combination would be what you want. > > Or you could just use a fixed rate bond with all coupons except the > last paying a null rate, or you can create a schedule with null > frequency. It depends on how the final payment accrues. Is the rate > accrued over the whole duration of the bond, or just a subperiod? > > Luigi > > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Piter D. <pit...@pi...> - 2012-01-14 20:46:56
|
Dagur,
See below a code that may help you. "Period(Once)" is what you look for.
Regards,
#include "stdafx.h"
#include <ql/quantlib.hpp>
#include <iostream>
using namespace QuantLib;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Date issueDate(Date(15, Oct, 2011)), maturityDate(Date(15, Oct, 2016));
Rate rate(0.10);
DayCounter dayCounter = Thirty360(Thirty360::European);
Schedule *schedule = new Schedule(issueDate,
maturityDate,
Period(Once),
Iceland(),
Unadjusted,
Unadjusted,
DateGeneration::Backward,
false);
InterestRate coupon(0.06,
dayCounter,
Simple, Annual);
FixedRateBond* bond = new FixedRateBond(0,
100.0,
*schedule,
vector<InterestRate>(1, coupon),
Unadjusted,
Real(100.0),
issueDate);
for (unsigned i = 0; i < bond->cashflows().size(); i++) {
cout<<"day["<<i<<"] is "<<bond->cashflows()[i]->date()<<"
"<<setprecision(15)
<<dayCounter.yearFraction(Date(1, Jun, 2011),
bond->cashflows()[i]->date())<<", cashflow["<<i<<"] is
"<<bond->cashflows()[i]->amount()<<endl;
}
return 0;
}
From: Dagur Gunnarsson [mailto:da...@ko...]
Sent: 14 January 2012 16:29
To: Luigi Ballabio
Cc: qua...@li...
Subject: Re: [Quantlib-users] Fixed rate bond
Hello,
The rate is accrued over the whole period, so in at the maturity date the
bond pays a coupon for the whole livetime of the bond, and the principal.
regards
Dagur G
On Tue, Jan 10, 2012 at 8:17 AM, Luigi Ballabio <lui...@gm...>
wrote:
On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <ste...@gm...>
wrote:
> Dagur Gunnarsson-2 wrote:
>> Is there a simple way to simulate a bond(fixed rate) that pays a single
>> coupon on the maturity day as well as the principal
>
> Looks like you can do this with a combination of a fixed rate bond with
> regular coupon (at least once a year), then subtract that with a series of
> fixed rate bonds with the same coupon but shorter duration + a series of
> zero coupon bonds with the same maturities as the series of fixed rate
bonds
> except the original bond. The combination would be what you want.
Or you could just use a fixed rate bond with all coupons except the
last paying a null rate, or you can create a schedule with null
frequency. It depends on how the final payment accrues. Is the rate
accrued over the whole duration of the bond, or just a subperiod?
Luigi
----------------------------------------------------------------------------
--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
QuantLib-users mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: StephenWong <ste...@gm...> - 2012-01-10 19:16:42
|
Luigi Ballabio wrote: > > On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <ste...@gm...> > wrote: >> Dagur Gunnarsson-2 wrote: >>> Is there a simple way to simulate a bond(fixed rate) that pays a single >>> coupon on the maturity day as well as the principal >> >> Looks like you can do this with a combination of a fixed rate bond with >> regular coupon (at least once a year), then subtract that with a series >> of >> fixed rate bonds with the same coupon but shorter duration + a series of >> zero coupon bonds with the same maturities as the series of fixed rate >> bonds >> except the original bond. The combination would be what you want. > > Or you could just use a fixed rate bond with all coupons except the > last paying a null rate, or you can create a schedule with null > frequency. It depends on how the final payment accrues. Is the rate > accrued over the whole duration of the bond, or just a subperiod? > > Luigi > > A fixed rate bond with all coupons except that last paying nothing? How is that going to help? You lost me. -- View this message in context: http://old.nabble.com/Fixed-rate-bond-tp33096297p33114429.html Sent from the quantlib-users mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2012-01-10 19:40:42
|
On Tue, Jan 10, 2012 at 8:16 PM, StephenWong <ste...@gm...> wrote: > A fixed rate bond with all coupons except that last paying nothing? How is > that going to help? You lost me. He wants no payments until maturity, at which point there's a coupon plus redemption. Unless I misunderstood you, you proposed to use a bond with regular yearly coupons and subtract a shorter one; this makes all coupons null except the last, as the payments from the two bonds cancel out (you then need another zero-coupon to balance the extra redemption). What I was saying is that, instead of multiple bonds, he can use a single bond and specify explicitly that the first coupons don't pay anything. Luigi |
|
From: StephenWong <ste...@gm...> - 2012-01-11 14:27:59
|
Luigi Ballabio wrote: > > On Tue, Jan 10, 2012 at 8:16 PM, StephenWong <ste...@gm...> > wrote: >> A fixed rate bond with all coupons except that last paying nothing? How >> is >> that going to help? You lost me. > > He wants no payments until maturity, at which point there's a coupon > plus redemption. > Unless I misunderstood you, you proposed to use a bond with regular > yearly coupons and subtract a shorter one; this makes all coupons null > except the last, as the payments from the two bonds cancel out (you > then need another zero-coupon to balance the extra redemption). > What I was saying is that, instead of multiple bonds, he can use a > single bond and specify explicitly that the first coupons don't pay > anything. > > Luigi > > Never mind! I misinterpreted what you wrote. -- View this message in context: http://old.nabble.com/Fixed-rate-bond-tp33096297p33121342.html Sent from the quantlib-users mailing list archive at Nabble.com. |