Re: getting the set of reset dates of a float leg
Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/RE-getting-the-set-of-reset-dates-of-a-f-loat-leg-tp2419p2425.html
At 02:02 PM 2/20/03 +0000, Chak Jack Wong wrote:
>Thanks a lot. However, the accrual start date is not really the reset date
>the reset date is calender.advance( accrualstartdate, -fixingdate, Days,
>Preceding )
Oops, disregard my first mail---I sent it before receiving Francesco's and
yours.
You stumbled upon an obvious oversight on our part. With the CVS version,
you can write:
for (i=leg.begin(); i!=leg.end(); ++i) {
Handle<FloatingRateCoupon> c = *i;
Date d = c->fixingDate();
...
}
but there was no such method in release 0.3.1. You can add it by applying
the patch I'm including below.
Sorry for the inconvenience,
Luigi
-- Here's the patch --
*** oldfloatingratecoupon.hpp Wed Jan 08 11:00:16 2003
--- floatingratecoupon.hpp Thu Feb 20 14:36:10 2003
***************
*** 63,68 ****
--- 63,69 ----
//@{
const Handle<Indexes::Xibor>& index() const;
int fixingDays() const;
+ Date fixingDate() const;
virtual Rate fixing() const;
Spread spread() const;
//@}
***************
*** 86,91 ****
--- 87,97 ----
inline int FloatingRateCoupon::fixingDays() const {
return fixingDays_;
+ }
+
+ inline Date FloatingRateCoupon::fixingDate() const {
+ return index_->calendar().advance(
+ accrualStartDate_, -fixingDays_, Days, Preceding);
}
inline Rate FloatingRateCoupon::fixing() const {