Coupons and Fixed Rate Legs, Take Two...

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Coupons and Fixed Rate Legs, Take Two...

Toyin Akin
Hi Chiara,

As you are the "THE EXPERT" regarding Bonds in my opinion...

I've been playing around with some of the Bond classes (FixedCouponBond in
particular) trying to match the prices within FinCad.

This really leads me onto the issue that I mentioned some months before
regarding the fact that the way reference dates are passed to coupon objects
for regular coupon periods were, I think, incorrect.

The coupons simply take their reference Dates from the adjusted start/end
dates when in fact I beleive that refDates should be the unadjusted dates
for the period. The same unadjusted dates that the schedule class internally
builds just before adjusting them.

In a nutshell, the refdates should be unaffected by holiday calendars.

I'm not sure what your take on this is, but with my limited testing, I've
found that I can match the prices of bonds priced within FinCad when I use
unadjusted reference dates.

I've included a modified schedule class (really exposing the unadjusted
dates array) and a new bondcashflowvectors class that uses the extra
information exposed from the schedule class.

Can you take a look and tell me what you think?

Is it also your understanding that the unadjusted reference dates should be
unadjusted dates for bonds? This I believe becomes very important once you
start playing with different daycounters.

There is also the issue of bond specifications where you may have a
different pricing algo for the first coupon period if there is only one
coupon period left to maturity.

Thus if I am pricing a 10 year bond and I require ISMA for the Yield
calculation type, but Simple if the calculation date is moved in such a
fashion that there is only one coupon period left to Bond maturity.

Any thoughts on this...?

Thanks in advance,
Toy out.

_________________________________________________________________
Win tickets to the sold out Live Earth concert!  http://liveearth.uk.msn.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

bondcashflowvectors.cpp (5K) Download Attachment
bondcashflowvectors.hpp (1K) Download Attachment
schedule.cpp (12K) Download Attachment
schedule.hpp (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Toyin Akin
Hi,

There is a small bug in the bond cashflow cpp file. You need to rename the
class name from ctBondLeg to BondLeg in order to compile it.

Toy out.

>From: "Toyin Akin" <[hidden email]>
>To: [hidden email], [hidden email]
>CC: [hidden email]
>Subject: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>Date: Tue, 24 Jul 2007 11:36:38 +0100
>
>Hi Chiara,
>
>As you are the "THE EXPERT" regarding Bonds in my opinion...
>
>I've been playing around with some of the Bond classes (FixedCouponBond in
>particular) trying to match the prices within FinCad.
>
>This really leads me onto the issue that I mentioned some months before
>regarding the fact that the way reference dates are passed to coupon
>objects for regular coupon periods were, I think, incorrect.
>
>The coupons simply take their reference Dates from the adjusted start/end
>dates when in fact I beleive that refDates should be the unadjusted dates
>for the period. The same unadjusted dates that the schedule class
>internally builds just before adjusting them.
>
>In a nutshell, the refdates should be unaffected by holiday calendars.
>
>I'm not sure what your take on this is, but with my limited testing, I've
>found that I can match the prices of bonds priced within FinCad when I use
>unadjusted reference dates.
>
>I've included a modified schedule class (really exposing the unadjusted
>dates array) and a new bondcashflowvectors class that uses the extra
>information exposed from the schedule class.
>
>Can you take a look and tell me what you think?
>
>Is it also your understanding that the unadjusted reference dates should be
>unadjusted dates for bonds? This I believe becomes very important once you
>start playing with different daycounters.
>
>There is also the issue of bond specifications where you may have a
>different pricing algo for the first coupon period if there is only one
>coupon period left to maturity.
>
>Thus if I am pricing a 10 year bond and I require ISMA for the Yield
>calculation type, but Simple if the calculation date is moved in such a
>fashion that there is only one coupon period left to Bond maturity.
>
>Any thoughts on this...?
>
>Thanks in advance,
>Toy out.
>
>_________________________________________________________________
>Win tickets to the sold out Live Earth concert!  
>http://liveearth.uk.msn.com


><< bondcashflowvectors.cpp >>


><< bondcashflowvectors.hpp >>


><< schedule.cpp >>


><< schedule.hpp >>


>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >>  http://get.splunk.com/


>_______________________________________________
>QuantLib-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/quantlib-users

_________________________________________________________________
Win tickets to the sold out Live Earth concert!  http://liveearth.uk.msn.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Toyin Akin

Hi again,

Another point that I would like to raise...

If you agree to the modifications in principal, then I believe that the
dirtyPriceFromYield() function within the bond.cpp class will benefit from
this because there are numerous calls to the InterestRate::discount()
function.

As this function takes reference dates as input parameters. We can now read
the reference dates directly from the coupon object rather than computing
them or setting them equal to the period start/end dates.

Of course, there is the question of reference dates concerning floating rate
legs too...

Toy out...

>From: "Toyin Akin" <[hidden email]>
>To: [hidden email], [hidden email], [hidden email]
>CC: [hidden email]
>Subject: RE: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>Date: Tue, 24 Jul 2007 11:46:29 +0100
>
>Hi,
>
>There is a small bug in the bond cashflow cpp file. You need to rename the
>class name from ctBondLeg to BondLeg in order to compile it.
>
>Toy out.
>
>>From: "Toyin Akin" <[hidden email]>
>>To: [hidden email], [hidden email]
>>CC: [hidden email]
>>Subject: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>>Date: Tue, 24 Jul 2007 11:36:38 +0100
>>
>>Hi Chiara,
>>
>>As you are the "THE EXPERT" regarding Bonds in my opinion...
>>
>>I've been playing around with some of the Bond classes (FixedCouponBond in
>>particular) trying to match the prices within FinCad.
>>
>>This really leads me onto the issue that I mentioned some months before
>>regarding the fact that the way reference dates are passed to coupon
>>objects for regular coupon periods were, I think, incorrect.
>>
>>The coupons simply take their reference Dates from the adjusted start/end
>>dates when in fact I beleive that refDates should be the unadjusted dates
>>for the period. The same unadjusted dates that the schedule class
>>internally builds just before adjusting them.
>>
>>In a nutshell, the refdates should be unaffected by holiday calendars.
>>
>>I'm not sure what your take on this is, but with my limited testing, I've
>>found that I can match the prices of bonds priced within FinCad when I use
>>unadjusted reference dates.
>>
>>I've included a modified schedule class (really exposing the unadjusted
>>dates array) and a new bondcashflowvectors class that uses the extra
>>information exposed from the schedule class.
>>
>>Can you take a look and tell me what you think?
>>
>>Is it also your understanding that the unadjusted reference dates should
>>be unadjusted dates for bonds? This I believe becomes very important once
>>you start playing with different daycounters.
>>
>>There is also the issue of bond specifications where you may have a
>>different pricing algo for the first coupon period if there is only one
>>coupon period left to maturity.
>>
>>Thus if I am pricing a 10 year bond and I require ISMA for the Yield
>>calculation type, but Simple if the calculation date is moved in such a
>>fashion that there is only one coupon period left to Bond maturity.
>>
>>Any thoughts on this...?
>>
>>Thanks in advance,
>>Toy out.
>>
>>_________________________________________________________________
>>Win tickets to the sold out Live Earth concert!  
>>http://liveearth.uk.msn.com
>
>
>><< bondcashflowvectors.cpp >>
>
>
>><< bondcashflowvectors.hpp >>
>
>
>><< schedule.cpp >>
>
>
>><< schedule.hpp >>
>
>
>>-------------------------------------------------------------------------
>>This SF.net email is sponsored by: Splunk Inc.
>>Still grepping through log files to find problems?  Stop.
>>Now Search log events and configuration files using AJAX and a browser.
>>Download your FREE copy of Splunk now >>  http://get.splunk.com/
>
>
>>_______________________________________________
>>QuantLib-users mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>_________________________________________________________________
>Win tickets to the sold out Live Earth concert!  
>http://liveearth.uk.msn.com
>

_________________________________________________________________
Watch all 9 Live Earth concerts live on MSN.  http://liveearth.uk.msn.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

John Maiden
In reply to this post by Toyin Akin
Ok, this is something that I haven't understood about bonds. Assuming that I can
buy a bond at any time, then shouldn't there be two different frequencies to
consider (and thus two different date schedules)? One frequency is tied to the
bond itself, the actual dates the coupon is paid. Yet there is also the
frequency, let's say daily for the sake of example, of the purchaser. I can buy
a bond on any day, which means that the loss of coupon for the person who sold
it to me has been been considered in the sale. The true value of the next coupon
will have already been adjusted so that I will only really receive accrued
between today and the next coupon dates, rather than the full amounts between
coupon dates. Please tell me if I'm off here and the legs already account for
this in some way. If not, wouldn't it make sense to have a schedule with two
frequencies, one for the bond coupon schedule and one for the potential holder
of the bond?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Coupons and Fixed Rate Legs, Take Two...

Piter Dias
In reply to this post by Toyin Akin
Guys,

Another interesting thing is compounding frequency, very important to Brazilian markets.
I sent a patch where you can use a InterestRate objects insteadof just Rate for FixedRateBond.
I would have to check Swaps and other classes too but in that time my focus where Brazilian public bonds.

Regards,
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

FORNAROLA CHIARA
In reply to this post by Toyin Akin
Hi Toyin,

before telling you my thoughts I'd like to know: what QuantLib release
you are using. Is it 0.8.0? From what you're writing it seems you're
still using the old version of fixedcouponbond which was renamed as
fixedratebond. This latest takes the schedule object as one of the input
for the construction of the bond object, and the schedule must be
constructed according inputing the following parameters:
datedDate i.e. the first interest accrual date (the one quoted in the
bond's prospectus usually isn't adjusted) of the bond;

maturityDate, i.e. the maturity date of the bond (the one quoted in the
bond's prospectus usually isn't adjusted);

Period(frequency), i.e. 0d, 1d, 3m, 6m, 1y depending on the payment
frequency of the bonds (once, daily, quarterly, semiannual, annual);

calendar, i.e. the calendar quoted in the prospectus of the bond;

accrualConvention, i.e. the adjustment applied to accrual start and end
dates of the bond (usually for Euro denominated bonds is "unadjusted");

accrualConventionTermination, i.e. the adjustment applied to the
maturity date (usually "unadjusted" if not differently specified in the
prospectus);

fromEnd, i.e. TRUE if you want to build the schedule backward, FALSE if
you want to start building the schedule rolling from the first payment
date (uasually the schedule is generated BACKWARD unless you have odd
last or first coupon). EOM, i.e. TRUE if you have a payment date which
falls for example on the 28th of February and, lets say pays
semiannually, you want that the next nominal date is 31st August (i.e.
the last day of the month) rather than the 28th of August. Usually this
parameter is equal to FALSE unless differently specified in the bond's
prospectus;

firstDate, i.e. the nominal date in which the first coupon date is
scheduled (unless you have odd cpn you don't need to pass this
parameter, but if you input this information you have to input a date
without business adjustment);

nextToLastDate, i.e. the nominal date in which the next to last coupon
date is schedule (unless you have odd cpn you don't need to pass this
parameter but if you input this information you have to input a date
without business adjustment).
FirstDate and Next to last date are optional parameters, you need them
only if the deal you have as an odd coupon.
With the bond's constructor taking a schedule object properly created
you shouldn't encounter any problem in replicating the bond's schedule
(payments date and start and end accrual dates). So please let me know
quant QuantLib release are you using.

Chiara

>-----Original Message-----
>From: Toyin Akin [mailto:[hidden email]]
>Sent: Tuesday, July 24, 2007 12:37 PM
>To: FORNAROLA CHIARA; [hidden email]
>Cc: [hidden email]
>Subject: Coupons and Fixed Rate Legs, Take Two...
>
>Hi Chiara,
>
>As you are the "THE EXPERT" regarding Bonds in my opinion...
>
>I've been playing around with some of the Bond classes (FixedCouponBond
in
>particular) trying to match the prices within FinCad.
>
>This really leads me onto the issue that I mentioned some months before
>regarding the fact that the way reference dates are passed to coupon
>objects
>for regular coupon periods were, I think, incorrect.
>
>The coupons simply take their reference Dates from the adjusted
start/end
>dates when in fact I beleive that refDates should be the unadjusted
dates
>for the period. The same unadjusted dates that the schedule class
>internally
>builds just before adjusting them.
>
>In a nutshell, the refdates should be unaffected by holiday calendars.
>
>I'm not sure what your take on this is, but with my limited testing,
I've
>found that I can match the prices of bonds priced within FinCad when I
use
>unadjusted reference dates.
>
>I've included a modified schedule class (really exposing the unadjusted
>dates array) and a new bondcashflowvectors class that uses the extra
>information exposed from the schedule class.
>
>Can you take a look and tell me what you think?
>
>Is it also your understanding that the unadjusted reference dates
should be
>unadjusted dates for bonds? This I believe becomes very important once
you

>start playing with different daycounters.
>
>There is also the issue of bond specifications where you may have a
>different pricing algo for the first coupon period if there is only one
>coupon period left to maturity.
>
>Thus if I am pricing a 10 year bond and I require ISMA for the Yield
>calculation type, but Simple if the calculation date is moved in such a
>fashion that there is only one coupon period left to Bond maturity.
>
>Any thoughts on this...?
>
>Thanks in advance,
>Toy out.
>
>_________________________________________________________________
>Win tickets to the sold out Live Earth concert!
>http://liveearth.uk.msn.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

FORNAROLA CHIARA
In reply to this post by Toyin Akin
Hi John,

You don't need two different schedules.
The bond's NPV already account for the behaviour you described.
Look at bond.cpp when calculating the instrument's npv.
There are specified both settlement's date and npv date.

Chiara

>-----Original Message-----
>From: [hidden email]
[mailto:quantlib-users-
>[hidden email]] On Behalf Of John Maiden
>Sent: Tuesday, July 24, 2007 5:22 PM
>To: [hidden email]
>Subject: Re: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>
>Ok, this is something that I haven't understood about bonds. Assuming
that
>I can
>buy a bond at any time, then shouldn't there be two different
frequencies
>to
>consider (and thus two different date schedules)? One frequency is tied
to
>the
>bond itself, the actual dates the coupon is paid. Yet there is also the
>frequency, let's say daily for the sake of example, of the purchaser. I
can
>buy
>a bond on any day, which means that the loss of coupon for the person
who
>sold
>it to me has been been considered in the sale. The true value of the
next
>coupon
>will have already been adjusted so that I will only really receive
accrued
>between today and the next coupon dates, rather than the full amounts
>between
>coupon dates. Please tell me if I'm off here and the legs already
account
>for
>this in some way. If not, wouldn't it make sense to have a schedule
with
>two
>frequencies, one for the bond coupon schedule and one for the potential
>holder
>of the bond?
>
>
>-----------------------------------------------------------------------
--
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >>  http://get.splunk.com/
>_______________________________________________
>QuantLib-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/quantlib-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

John Maiden
Chiara-

     But what if I'm working with a convertible bond? My initial problem was
that I wanted to consider a convertible bond where I'd like to find the daily
price with a semi-annual coupon. For the convertible bond class this means I set
up a daily coupon schedule, and I can't control when the coupon payment dates
occur.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

FORNAROLA CHIARA
In reply to this post by Toyin Akin
John,

I don't have any experience with convertible bonds and with
convertiblebond.cpp.
So what I all can do is to put in my todo list to have a look at the
code (with low priority). I hope that in the while somebody, who has
used convertiblebond class extensively and at the same time as a good
knowledge of convertible bonds' market practice, will reply to you.

Chiara
p.s. maybe if you need some handbook on cb markets I can help you.

>-----Original Message-----
>From: [hidden email]
[mailto:quantlib-users-
>[hidden email]] On Behalf Of John Maiden
>Sent: Tuesday, July 24, 2007 6:39 PM
>To: [hidden email]
>Subject: Re: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>
>Chiara-
>
>     But what if I'm working with a convertible bond? My initial
problem
>was
>that I wanted to consider a convertible bond where I'd like to find the
>daily
>price with a semi-annual coupon. For the convertible bond class this
means
>I set
>up a daily coupon schedule, and I can't control when the coupon payment
>dates
>occur.
>
>
>
>-----------------------------------------------------------------------
--
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >>  http://get.splunk.com/
>_______________________________________________
>QuantLib-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/quantlib-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Toyin Akin
In reply to this post by FORNAROLA CHIARA
Hi Chiara,

Sorry, I guess I'm still using the old naming convention for Bonds.

I'm using the latest QuantLib source checked out from SVN as of yesterday.

My issue is really with what are the correct values to pass to the
referenceDates when building bond coupon periods. Or any coupon period for
that matter. Adjusted dates or unadjusted dates?

It is my understanding that the calculation methodology from the dayCounter
classes require unadjusted referenceDates. But yet, adjusted dates are
passed into the constructor of Coupon objects.

The function accrualPeriod() from the Coupon class delegate to the
dayCounter object for computation.

There is an example I reported before where given a 3 month period, if you
assume an extreme adjustment scheme where the start date is shifted to the
left by a few weeks and the end date is shifted to the right by a few weeks
you still end up with 0.25 as the accrualPeriod() because the ref dates are
the same as the period dates. Once you pass in unadjusted ref dates the
value returned looks decent.

In most cases the value of the refDates will equal the period dates and
things are fine, but I found that some of the bonds I am pricing differs
from FinCad when there are one or more date adjustments occuring. The actual
resulting dates are the same (unadjusted and adjusted) but not the PV. I
believe this is because of the way the discount() function works
(accumulation of the discount factor) within the InterestRate object used by
the dirtyPrice() function. This function is very sensitive to the refDates
parameter.

Do you have examples of a Bond where there are quite a few date adjustments
occuring and the value agrees with Bloomberg? Even bonds with different
dayCounters within its specification?

I could be wrong regarding this fact, which is why I'm looking for a
definate answer.

Thanks in advance...
Toy out...

>From: "FORNAROLA CHIARA" <[hidden email]>
>To: "Toyin Akin" <[hidden email]>, <[hidden email]>
>CC: <[hidden email]>
>Subject: RE: Coupons and Fixed Rate Legs, Take Two...
>Date: Tue, 24 Jul 2007 17:51:24 +0200
>
>Hi Toyin,
>
>before telling you my thoughts I'd like to know: what QuantLib release
>you are using. Is it 0.8.0? From what you're writing it seems you're
>still using the old version of fixedcouponbond which was renamed as
>fixedratebond. This latest takes the schedule object as one of the input
>for the construction of the bond object, and the schedule must be
>constructed according inputing the following parameters:
>datedDate i.e. the first interest accrual date (the one quoted in the
>bond's prospectus usually isn't adjusted) of the bond;
>
>maturityDate, i.e. the maturity date of the bond (the one quoted in the
>bond's prospectus usually isn't adjusted);
>
>Period(frequency), i.e. 0d, 1d, 3m, 6m, 1y depending on the payment
>frequency of the bonds (once, daily, quarterly, semiannual, annual);
>
>calendar, i.e. the calendar quoted in the prospectus of the bond;
>
>accrualConvention, i.e. the adjustment applied to accrual start and end
>dates of the bond (usually for Euro denominated bonds is "unadjusted");
>
>accrualConventionTermination, i.e. the adjustment applied to the
>maturity date (usually "unadjusted" if not differently specified in the
>prospectus);
>
>fromEnd, i.e. TRUE if you want to build the schedule backward, FALSE if
>you want to start building the schedule rolling from the first payment
>date (uasually the schedule is generated BACKWARD unless you have odd
>last or first coupon). EOM, i.e. TRUE if you have a payment date which
>falls for example on the 28th of February and, lets say pays
>semiannually, you want that the next nominal date is 31st August (i.e.
>the last day of the month) rather than the 28th of August. Usually this
>parameter is equal to FALSE unless differently specified in the bond's
>prospectus;
>
>firstDate, i.e. the nominal date in which the first coupon date is
>scheduled (unless you have odd cpn you don't need to pass this
>parameter, but if you input this information you have to input a date
>without business adjustment);
>
>nextToLastDate, i.e. the nominal date in which the next to last coupon
>date is schedule (unless you have odd cpn you don't need to pass this
>parameter but if you input this information you have to input a date
>without business adjustment).
>FirstDate and Next to last date are optional parameters, you need them
>only if the deal you have as an odd coupon.
>With the bond's constructor taking a schedule object properly created
>you shouldn't encounter any problem in replicating the bond's schedule
>(payments date and start and end accrual dates). So please let me know
>quant QuantLib release are you using.
>
>Chiara
> >-----Original Message-----
> >From: Toyin Akin [mailto:[hidden email]]
> >Sent: Tuesday, July 24, 2007 12:37 PM
> >To: FORNAROLA CHIARA; [hidden email]
> >Cc: [hidden email]
> >Subject: Coupons and Fixed Rate Legs, Take Two...
> >
> >Hi Chiara,
> >
> >As you are the "THE EXPERT" regarding Bonds in my opinion...
> >
> >I've been playing around with some of the Bond classes (FixedCouponBond
>in
> >particular) trying to match the prices within FinCad.
> >
> >This really leads me onto the issue that I mentioned some months before
> >regarding the fact that the way reference dates are passed to coupon
> >objects
> >for regular coupon periods were, I think, incorrect.
> >
> >The coupons simply take their reference Dates from the adjusted
>start/end
> >dates when in fact I beleive that refDates should be the unadjusted
>dates
> >for the period. The same unadjusted dates that the schedule class
> >internally
> >builds just before adjusting them.
> >
> >In a nutshell, the refdates should be unaffected by holiday calendars.
> >
> >I'm not sure what your take on this is, but with my limited testing,
>I've
> >found that I can match the prices of bonds priced within FinCad when I
>use
> >unadjusted reference dates.
> >
> >I've included a modified schedule class (really exposing the unadjusted
> >dates array) and a new bondcashflowvectors class that uses the extra
> >information exposed from the schedule class.
> >
> >Can you take a look and tell me what you think?
> >
> >Is it also your understanding that the unadjusted reference dates
>should be
> >unadjusted dates for bonds? This I believe becomes very important once
>you
> >start playing with different daycounters.
> >
> >There is also the issue of bond specifications where you may have a
> >different pricing algo for the first coupon period if there is only one
> >coupon period left to maturity.
> >
> >Thus if I am pricing a 10 year bond and I require ISMA for the Yield
> >calculation type, but Simple if the calculation date is moved in such a
> >fashion that there is only one coupon period left to Bond maturity.
> >
> >Any thoughts on this...?
> >
> >Thanks in advance,
> >Toy out.
> >
> >_________________________________________________________________
> >Win tickets to the sold out Live Earth concert!
> >http://liveearth.uk.msn.com
_________________________________________________________________
Need a brain boost? Recharge with a stimulating game. Play now! 
http://club.live.com/home.aspx?icid=club_hotmailtextlink1



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

FORNAROLA CHIARA
In reply to this post by Toyin Akin
Hi Toyin,

The dates you have to pass to the schedule should be unadjusted.
Then the dates used buy the coupon are adjusted or not, depending on
what kind of input you pass to the schedule for accrualConvention and
for accrualConventionTermination.
If you have a look at the testsuite in assetswap.cpp you can find the
examples you're looking for.
I don't have fincad installed on my workstation so I can't replicate
your test, but I've tested market prices in asset swap with Bloomberg
and checked the bond's cashflow analysis QL vs Bloomberg, it was
correct.
In Bloomberg the function SWPM -ASW applies the default "unadjusted" for
the accrual dates, but you of course can change the payment convention
according to the bond's prospectus.
Unadjusted accrual dates is the standard for bonds and structured bonds
denominated in Euro, but it has also happened to me to see some bond's
prospectus, where accrual period is mentioned to be adjusted. This I
believe occurs sporadically.
Regarding bond's price given the yield I think it should be reviewed. At
the moment, I don't use it since I calculate bonds' market price given
asset swap spread or given Z-spread.
Anyway I've in my todo list to work at the bond class so to make it more
flexible...You'll see the changes in the next days I think (I hope)...
Chiara

>-----Original Message-----
>From: Toyin Akin [mailto:[hidden email]]
>Sent: Tuesday, July 24, 2007 12:37 PM
>To: FORNAROLA CHIARA; [hidden email]
>Cc: [hidden email]
>Subject: Coupons and Fixed Rate Legs, Take Two...
>
>Hi Chiara,
>
>As you are the "THE EXPERT" regarding Bonds in my opinion...
>
>I've been playing around with some of the Bond classes (FixedCouponBond
in
>particular) trying to match the prices within FinCad.
>
>This really leads me onto the issue that I mentioned some months before
>regarding the fact that the way reference dates are passed to coupon
>objects
>for regular coupon periods were, I think, incorrect.
>
>The coupons simply take their reference Dates from the adjusted
start/end
>dates when in fact I beleive that refDates should be the unadjusted
dates
>for the period. The same unadjusted dates that the schedule class
>internally
>builds just before adjusting them.
>
>In a nutshell, the refdates should be unaffected by holiday calendars.
>
>I'm not sure what your take on this is, but with my limited testing,
I've
>found that I can match the prices of bonds priced within FinCad when I
use
>unadjusted reference dates.
>
>I've included a modified schedule class (really exposing the unadjusted
>dates array) and a new bondcashflowvectors class that uses the extra
>information exposed from the schedule class.
>
>Can you take a look and tell me what you think?
>
>Is it also your understanding that the unadjusted reference dates
should be
>unadjusted dates for bonds? This I believe becomes very important once
you

>start playing with different daycounters.
>
>There is also the issue of bond specifications where you may have a
>different pricing algo for the first coupon period if there is only one
>coupon period left to maturity.
>
>Thus if I am pricing a 10 year bond and I require ISMA for the Yield
>calculation type, but Simple if the calculation date is moved in such a
>fashion that there is only one coupon period left to Bond maturity.
>
>Any thoughts on this...?
>
>Thanks in advance,
>Toy out.
>
>_________________________________________________________________
>Win tickets to the sold out Live Earth concert!
>http://liveearth.uk.msn.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Luigi Ballabio
In reply to this post by John Maiden
On Tue, 2007-07-24 at 15:21 +0000, John Maiden wrote:
> I can buy
> a bond on any day, which means that the loss of coupon for the person who sold
> it to me has been been considered in the sale. The true value of the next coupon
> will have already been adjusted so that I will only really receive accrued
> between today and the next coupon dates, rather than the full amounts between
> coupon dates.

This is already taken into account by the cleanPrice() method.

Later,
        Luigi


--

Age is an issue of mind over matter. If you don't mind, it doesn't
matter.
-- Mark Twain



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Toyin Akin
In reply to this post by FORNAROLA CHIARA
Hi Chiara,

Thanks a lot for looking into this for me.

I must say that I'm pretty impressed with the Bonds framework compared to 9
months ago.

I quickly saw a piece of code within QuantLib where a leg could be valued
with an exDividendDays parameter attached. I think it's npv() within the
cashflows framework.

Could this be the beginnings of an exDividend days for bonds... (gotta try
eh...!!!)

Toy out.

>From: "FORNAROLA CHIARA" <[hidden email]>
>To: "Toyin Akin" <[hidden email]>, <[hidden email]>
>CC: <[hidden email]>
>Subject: RE: Coupons and Fixed Rate Legs, Take Two...
>Date: Thu, 26 Jul 2007 12:17:45 +0200
>
>Hi Toyin,
>
>The dates you have to pass to the schedule should be unadjusted.
>Then the dates used buy the coupon are adjusted or not, depending on
>what kind of input you pass to the schedule for accrualConvention and
>for accrualConventionTermination.
>If you have a look at the testsuite in assetswap.cpp you can find the
>examples you're looking for.
>I don't have fincad installed on my workstation so I can't replicate
>your test, but I've tested market prices in asset swap with Bloomberg
>and checked the bond's cashflow analysis QL vs Bloomberg, it was
>correct.
>In Bloomberg the function SWPM -ASW applies the default "unadjusted" for
>the accrual dates, but you of course can change the payment convention
>according to the bond's prospectus.
>Unadjusted accrual dates is the standard for bonds and structured bonds
>denominated in Euro, but it has also happened to me to see some bond's
>prospectus, where accrual period is mentioned to be adjusted. This I
>believe occurs sporadically.
>Regarding bond's price given the yield I think it should be reviewed. At
>the moment, I don't use it since I calculate bonds' market price given
>asset swap spread or given Z-spread.
>Anyway I've in my todo list to work at the bond class so to make it more
>flexible...You'll see the changes in the next days I think (I hope)...
>Chiara
> >-----Original Message-----
> >From: Toyin Akin [mailto:[hidden email]]
> >Sent: Tuesday, July 24, 2007 12:37 PM
> >To: FORNAROLA CHIARA; [hidden email]
> >Cc: [hidden email]
> >Subject: Coupons and Fixed Rate Legs, Take Two...
> >
> >Hi Chiara,
> >
> >As you are the "THE EXPERT" regarding Bonds in my opinion...
> >
> >I've been playing around with some of the Bond classes (FixedCouponBond
>in
> >particular) trying to match the prices within FinCad.
> >
> >This really leads me onto the issue that I mentioned some months before
> >regarding the fact that the way reference dates are passed to coupon
> >objects
> >for regular coupon periods were, I think, incorrect.
> >
> >The coupons simply take their reference Dates from the adjusted
>start/end
> >dates when in fact I beleive that refDates should be the unadjusted
>dates
> >for the period. The same unadjusted dates that the schedule class
> >internally
> >builds just before adjusting them.
> >
> >In a nutshell, the refdates should be unaffected by holiday calendars.
> >
> >I'm not sure what your take on this is, but with my limited testing,
>I've
> >found that I can match the prices of bonds priced within FinCad when I
>use
> >unadjusted reference dates.
> >
> >I've included a modified schedule class (really exposing the unadjusted
> >dates array) and a new bondcashflowvectors class that uses the extra
> >information exposed from the schedule class.
> >
> >Can you take a look and tell me what you think?
> >
> >Is it also your understanding that the unadjusted reference dates
>should be
> >unadjusted dates for bonds? This I believe becomes very important once
>you
> >start playing with different daycounters.
> >
> >There is also the issue of bond specifications where you may have a
> >different pricing algo for the first coupon period if there is only one
> >coupon period left to maturity.
> >
> >Thus if I am pricing a 10 year bond and I require ISMA for the Yield
> >calculation type, but Simple if the calculation date is moved in such a
> >fashion that there is only one coupon period left to Bond maturity.
> >
> >Any thoughts on this...?
> >
> >Thanks in advance,
> >Toy out.
> >
> >_________________________________________________________________
> >Win tickets to the sold out Live Earth concert!
> >http://liveearth.uk.msn.com

_________________________________________________________________
The next generation of Hotmail is here!  http://www.newhotmail.co.uk


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Luigi Ballabio
In reply to this post by Toyin Akin
On Tue, 2007-07-24 at 11:36 +0100, Toyin Akin wrote:

> The coupons simply take their reference Dates from the adjusted start/end
> dates when in fact I beleive that refDates should be the unadjusted dates
> for the period. The same unadjusted dates that the schedule class internally
> builds just before adjusting them.
>
> In a nutshell, the refdates should be unaffected by holiday calendars.
>
> I've included a modified schedule class (really exposing the unadjusted
> dates array) and a new bondcashflowvectors class that uses the extra
> information exposed from the schedule class.

Toyin,
        it should not be necessary to modify the actual code. Bonds take both a
schedule and a payment-adjustment convention. If you build your schedule
without adjustment, the start and end dates for the coupon should remain
unadjusted and only the payment date will be affected by
holidays---unless, of course, the coupon-building code does some other
adjustment; and unless, of course, I'm missing something...

Luigi


--

I am extraordinarily patient, provided I get my own way in the end.
-- Margaret Thatcher



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Luigi Ballabio
On Wed, 2007-08-01 at 11:10 +0200, Luigi Ballabio wrote:
> it should not be necessary to modify the actual code.

Oops---I let some Italian slip through. I meant "the current code"...

Luigi


--

Olmstead's Law:
After all is said and done, a hell of a lot more is said
than done.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Coupons and Fixed Rate Legs, Take Two...

Toyin Akin
In reply to this post by Luigi Ballabio
Hi Luigi,

Okay, it's becoming clearer now.

The only issue I had/have is that most Bonds when quoting for the yield do
not apply adjusted dates, thus naturally, the calendar passed in will be the
Null Calendar. However when one wants to report True yield (where a calendar
is needed), it seems like you have to rebuild the bond from scratch using
the correct calendar.

Thus (from the last time I checked), it's not possible to request yield and
true yield from the same bond object.

When a calendar object is passed in, (as I understand it), you are
requesting true yield.

Is this your understanding too?

It would be nice to be able to request true yield and regular (unadjusted)
yield without building two bond objects.

Best Regards,
Toyin Akin.

>From: Luigi Ballabio <[hidden email]>
>To: Toyin Akin <[hidden email]>
>CC: [hidden email], [hidden email],  
>[hidden email]
>Subject: Re: [Quantlib-users] Coupons and Fixed Rate Legs, Take Two...
>Date: Wed, 01 Aug 2007 11:10:54 +0200
>
>On Tue, 2007-07-24 at 11:36 +0100, Toyin Akin wrote:
> > The coupons simply take their reference Dates from the adjusted
>start/end
> > dates when in fact I beleive that refDates should be the unadjusted
>dates
> > for the period. The same unadjusted dates that the schedule class
>internally
> > builds just before adjusting them.
> >
> > In a nutshell, the refdates should be unaffected by holiday calendars.
> >
> > I've included a modified schedule class (really exposing the unadjusted
> > dates array) and a new bondcashflowvectors class that uses the extra
> > information exposed from the schedule class.
>
>Toyin,
> it should not be necessary to modify the actual code. Bonds take both a
>schedule and a payment-adjustment convention. If you build your schedule
>without adjustment, the start and end dates for the coupon should remain
>unadjusted and only the payment date will be affected by
>holidays---unless, of course, the coupon-building code does some other
>adjustment; and unless, of course, I'm missing something...
>
>Luigi
>
>
>--
>
>I am extraordinarily patient, provided I get my own way in the end.
>-- Margaret Thatcher
>
>

_________________________________________________________________
Got a favourite clothes shop, bar or restaurant? Share your local knowledge  
http://www.backofmyhand.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users