Hi Chak
given that leg_ is a std::vector<Handle<CashFlow> > you could try: std::vector<Handle<CashFlow> >::const_iterator begin, end; begin = leg_.begin(); end = leg_.end(); for (; begin != end; ++begin) { Handle<Coupon> coupon = *begin; QL_ENSURE(!coupon.isNull(), "not a coupon"); Date payDate = coupon->date(); Date cashFlowAccrualStartDate = coupon->accrualStartDate(); } -----Original Message----- From: Chak Jack Wong [mailto:[hidden email]] Sent: Thursday, February 20, 2003 2:31 PM To: [hidden email] Subject: [Quantlib-users] getting the set of reset dates of a float leg Hi, I have got some trouble of getting all the reset dates from a float leg. |
Hi, Perssin,
Thanks a lot. However, the accrual start date is not really the reset date the reset date is calender.advance( accrualstartdate, -fixingdate, Days, Preceding ) See FloatingReateCoupon::Amount() Jack
Perissin Francesco wrote:
--
|
En réponse à Chak Jack Wong <[hidden email]>:
Hi all, The solution is in the cvs tree. Now, the FloatingRateCoupon contains a virtual fixingDate() method. The use of Handle<FloatingRateCoupon> provides you a fixing date. Nicolas > Hi, Perssin, > Thanks a lot. However, the accrual start date is not really the reset > date > the reset date is calender.advance( accrualstartdate, -fixingdate, > Days, Preceding ) > See FloatingReateCoupon::Amount() > > > Jack > > > > Perissin Francesco wrote: > > > > > > > Hi Chak > > > > given that leg_ is a std::vector<Handle<CashFlow> > > > you could try: > > > > > > std::vector<Handle<CashFlow> >::const_iterator begin, end; > > begin = leg_.begin(); > > end = leg_.end(); > > for (; begin != end; ++begin) { > > Handle<Coupon> coupon = *begin; > > QL_ENSURE(!coupon.isNull(), "not a coupon"); > > Date payDate = coupon->date(); > > Date cashFlowAccrualStartDate = coupon->accrualStartDate(); > > } > > > > > > > > -----Original Message----- > > From: Chak Jack Wong [mailto:[hidden email]] > > Sent: Thursday, February 20, 2003 2:31 PM > > To: [hidden email] > > Subject: [Quantlib-users] getting the set of reset dates of a float > > leg > > > > Hi, > > I have got some trouble of getting all the reset dates from a float > > leg. > > > > From the FloatingRateCouponVector function, I can only get a vector< > > handle< cashflow > > , from which I can get paydates, but not the > > reset > > dates. I can't get this from the floatratecoupon either. > > What do I miss? > > Jack > > > > -- > > This is not an offer (or solicitation of an offer) to buy/sell the > > securities/instruments mentioned or an official confirmation. > Morgan > > Stanley may deal as principal in or own or act as market maker for > > securities/instruments mentioned or may advise the issuers. This > may > > refer to a research analyst/research report. Unless indicated, these > > views are the author's and may differ from those of Morgan Stanley > > research or others in the Firm. We do not represent this is accurate > > or > > complete and we may not update this. Past performance is not > > indicative > > of future returns. For additional information, research reports and > > important disclosures, contact me or see https://secure.ms.com. You > > should not use email to request, authorize or effect the purchase or > > sale of any security or instrument, to send transfer instructions, > or > > to > > effect any other transactions. We cannot guarantee that any such > > requests received via email will be processed in a timely manner. > > This > > communication is solely for the addressee(s) and may contain > > confidential information. We do not waive confidentiality by > > mistransmission. Contact me if you do not wish to receive these > > communications. In the UK, this communication is directed in the UK > > to > > those persons who are market counterparties or intermediate > customers > > (as defined in the UK Financial Services Authority's rules). > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > > The most comprehensive and flexible code editor you can use. > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day > Trial. > > > > www.slickedit.com/sourceforge > > _______________________________________________ > > Quantlib-users mailing list > > [hidden email] > > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ############################### DISCLAIMER > > ################################# > > > > This message (including any attachments) is confidential and may be > > privileged. If you have received it by mistake please notify the > > sender by > > return e-mail and delete this message from your system. Any > > unauthorised > > use or dissemination of this message in whole or in part is strictly > > prohibited. Please note that e-mails are susceptible to change. > Banca > > del > > Gottardo (including its group companies) shall not be liable for the > > improper or incomplete transmission of the information contained in > > this > > communication nor for any delay in its receipt or damage to your > > system. > > Banca del Gottardo (or its group companies) does not guarantee that > > the > > integrity of this communication has been maintained nor that this > > communication is free of viruses, interceptions or interference. > > > > > > > ########################################################################### > > -- > This is not an offer (or solicitation of an offer) to buy/sell the > securities/instruments mentioned or an official confirmation. Morgan > Stanley may deal as principal in or own or act as market maker for > securities/instruments mentioned or may advise the issuers. This may > refer to a research analyst/research report. Unless indicated, these > views are the author's and may differ from those of Morgan Stanley > research or others in the Firm. We do not represent this is accurate > or > complete and we may not update this. Past performance is not > indicative > of future returns. For additional information, research reports and > important disclosures, contact me or see https://secure.ms.com. You > should not use email to request, authorize or effect the purchase or > sale of any security or instrument, to send transfer instructions, or > to > effect any other transactions. We cannot guarantee that any such > requests received via email will be processed in a timely manner. > This > communication is solely for the addressee(s) and may contain > confidential information. We do not waive confidentiality by > mistransmission. Contact me if you do not wish to receive these > communications. In the UK, this communication is directed in the UK > to > those persons who are market counterparties or intermediate customers > (as defined in the UK Financial Services Authority's rules). > > -- Nicolas Di Césaré http://nicolas.dicesare.free.fr |
In reply to this post by Chak Jack Wong
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 { |
In reply to this post by Nicolas Di Césaré
Thanks a lot Nicolas and Luigi, I will check out the CVS version.
Jack Nicolas Di Césaré wrote: > En réponse à Chak Jack Wong <[hidden email]>: > > Hi all, > > The solution is in the cvs tree. Now, the FloatingRateCoupon contains a virtual > fixingDate() method. The use of Handle<FloatingRateCoupon> provides you > a fixing date. > > Nicolas > > > Hi, Perssin, > > Thanks a lot. However, the accrual start date is not really the reset > > date > > the reset date is calender.advance( accrualstartdate, -fixingdate, > > Days, Preceding ) > > See FloatingReateCoupon::Amount() > > > > > > Jack > > > > > > > > Perissin Francesco wrote: > > > > > > > > > > > Hi Chak > > > > > > given that leg_ is a std::vector<Handle<CashFlow> > > > > you could try: > > > > > > > > > std::vector<Handle<CashFlow> >::const_iterator begin, end; > > > begin = leg_.begin(); > > > end = leg_.end(); > > > for (; begin != end; ++begin) { > > > Handle<Coupon> coupon = *begin; > > > QL_ENSURE(!coupon.isNull(), "not a coupon"); > > > Date payDate = coupon->date(); > > > Date cashFlowAccrualStartDate = coupon->accrualStartDate(); > > > } > > > > > > > > > > > > -----Original Message----- > > > From: Chak Jack Wong [mailto:[hidden email]] > > > Sent: Thursday, February 20, 2003 2:31 PM > > > To: [hidden email] > > > Subject: [Quantlib-users] getting the set of reset dates of a float > > > leg > > > > > > Hi, > > > I have got some trouble of getting all the reset dates from a float > > > leg. > > > > > > From the FloatingRateCouponVector function, I can only get a vector< > > > handle< cashflow > > , from which I can get paydates, but not the > > > reset > > > dates. I can't get this from the floatratecoupon either. > > > What do I miss? > > > Jack > > > > > > -- > > > This is not an offer (or solicitation of an offer) to buy/sell the > > > securities/instruments mentioned or an official confirmation. > > Morgan > > > Stanley may deal as principal in or own or act as market maker for > > > securities/instruments mentioned or may advise the issuers. This > > may > > > refer to a research analyst/research report. Unless indicated, these > > > views are the author's and may differ from those of Morgan Stanley > > > research or others in the Firm. We do not represent this is accurate > > > or > > > complete and we may not update this. Past performance is not > > > indicative > > > of future returns. For additional information, research reports and > > > important disclosures, contact me or see https://secure.ms.com. You > > > should not use email to request, authorize or effect the purchase or > > > sale of any security or instrument, to send transfer instructions, > > or > > > to > > > effect any other transactions. We cannot guarantee that any such > > > requests received via email will be processed in a timely manner. > > > This > > > communication is solely for the addressee(s) and may contain > > > confidential information. We do not waive confidentiality by > > > mistransmission. Contact me if you do not wish to receive these > > > communications. In the UK, this communication is directed in the UK > > > to > > > those persons who are market counterparties or intermediate > > customers > > > (as defined in the UK Financial Services Authority's rules). > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > > > The most comprehensive and flexible code editor you can use. > > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day > > Trial. > > > > > > www.slickedit.com/sourceforge > > > _______________________________________________ > > > Quantlib-users mailing list > > > [hidden email] > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > ############################### DISCLAIMER > > > ################################# > > > > > > This message (including any attachments) is confidential and may be > > > privileged. If you have received it by mistake please notify the > > > sender by > > > return e-mail and delete this message from your system. Any > > > unauthorised > > > use or dissemination of this message in whole or in part is strictly > > > prohibited. Please note that e-mails are susceptible to change. > > Banca > > > del > > > Gottardo (including its group companies) shall not be liable for the > > > improper or incomplete transmission of the information contained in > > > this > > > communication nor for any delay in its receipt or damage to your > > > system. > > > Banca del Gottardo (or its group companies) does not guarantee that > > > the > > > integrity of this communication has been maintained nor that this > > > communication is free of viruses, interceptions or interference. > > > > > > > > > > > ########################################################################### > > > > -- > > This is not an offer (or solicitation of an offer) to buy/sell the > > securities/instruments mentioned or an official confirmation. Morgan > > Stanley may deal as principal in or own or act as market maker for > > securities/instruments mentioned or may advise the issuers. This may > > refer to a research analyst/research report. Unless indicated, these > > views are the author's and may differ from those of Morgan Stanley > > research or others in the Firm. We do not represent this is accurate > > or > > complete and we may not update this. Past performance is not > > indicative > > of future returns. For additional information, research reports and > > important disclosures, contact me or see https://secure.ms.com. You > > should not use email to request, authorize or effect the purchase or > > sale of any security or instrument, to send transfer instructions, or > > to > > effect any other transactions. We cannot guarantee that any such > > requests received via email will be processed in a timely manner. > > This > > communication is solely for the addressee(s) and may contain > > confidential information. We do not waive confidentiality by > > mistransmission. Contact me if you do not wish to receive these > > communications. In the UK, this communication is directed in the UK > > to > > those persons who are market counterparties or intermediate customers > > (as defined in the UK Financial Services Authority's rules). > > > > > > -- > Nicolas Di Césaré > http://nicolas.dicesare.free.fr -- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com. You should not use email to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via email will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules). |
Hi, I propose to add two functions to the FloatingRateCoupon.hpp, I wonder if people
agree on that in floatingratecoupon.hpp //! the first date it looks up the discount curve when valuing the libor payment virtual Date fixingValueDate() const = 0; //! the end date it looks up the discount curve //! so that for a forward libor coupon, the discount at the adjustedAccruedEndDate //! divided by the discount at the fixingValueDate minus one is the value of the coupon virtual Date adjustedAccruedEndDate() const = 0; and in parcoupon.hpp, we add inline Date ParCoupon::fixingValueDate() const { return index_->calendar().advance( fixingDate(), index_->settlementDays(), Days); } inline Date ParCoupon::adjustedAccruedEndDate() const { Date temp = index_->calendar().advance(accrualEndDate_,-fixingDays_, Days); return index_->calendar().advance(temp, index_->settlementDays(), Days); } This is useful in retrieving dates information for cashflow display and construction of some other instruments. Jack Chak Jack Wong wrote: > Thanks a lot Nicolas and Luigi, I will check out the CVS version. > Jack > > Nicolas Di Césaré wrote: > > > En réponse à Chak Jack Wong <[hidden email]>: > > > > Hi all, > > > > The solution is in the cvs tree. Now, the FloatingRateCoupon contains a virtual > > fixingDate() method. The use of Handle<FloatingRateCoupon> provides you > > a fixing date. > > > > Nicolas > > > > > Hi, Perssin, > > > Thanks a lot. However, the accrual start date is not really the reset > > > date > > > the reset date is calender.advance( accrualstartdate, -fixingdate, > > > Days, Preceding ) > > > See FloatingReateCoupon::Amount() > > > > > > > > > Jack > > > > > > > > > > > > Perissin Francesco wrote: > > > > > > > > > > > > > > > Hi Chak > > > > > > > > given that leg_ is a std::vector<Handle<CashFlow> > > > > > you could try: > > > > > > > > > > > > std::vector<Handle<CashFlow> >::const_iterator begin, end; > > > > begin = leg_.begin(); > > > > end = leg_.end(); > > > > for (; begin != end; ++begin) { > > > > Handle<Coupon> coupon = *begin; > > > > QL_ENSURE(!coupon.isNull(), "not a coupon"); > > > > Date payDate = coupon->date(); > > > > Date cashFlowAccrualStartDate = coupon->accrualStartDate(); > > > > } > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Chak Jack Wong [mailto:[hidden email]] > > > > Sent: Thursday, February 20, 2003 2:31 PM > > > > To: [hidden email] > > > > Subject: [Quantlib-users] getting the set of reset dates of a float > > > > leg > > > > > > > > Hi, > > > > I have got some trouble of getting all the reset dates from a float > > > > leg. > > > > > > > > From the FloatingRateCouponVector function, I can only get a vector< > > > > handle< cashflow > > , from which I can get paydates, but not the > > > > reset > > > > dates. I can't get this from the floatratecoupon either. > > > > What do I miss? > > > > Jack > > > > > > > > -- > > > > This is not an offer (or solicitation of an offer) to buy/sell the > > > > securities/instruments mentioned or an official confirmation. > > > Morgan > > > > Stanley may deal as principal in or own or act as market maker for > > > > securities/instruments mentioned or may advise the issuers. This > > > may > > > > refer to a research analyst/research report. Unless indicated, these > > > > views are the author's and may differ from those of Morgan Stanley > > > > research or others in the Firm. We do not represent this is accurate > > > > or > > > > complete and we may not update this. Past performance is not > > > > indicative > > > > of future returns. For additional information, research reports and > > > > important disclosures, contact me or see https://secure.ms.com. You > > > > should not use email to request, authorize or effect the purchase or > > > > sale of any security or instrument, to send transfer instructions, > > > or > > > > to > > > > effect any other transactions. We cannot guarantee that any such > > > > requests received via email will be processed in a timely manner. > > > > This > > > > communication is solely for the addressee(s) and may contain > > > > confidential information. We do not waive confidentiality by > > > > mistransmission. Contact me if you do not wish to receive these > > > > communications. In the UK, this communication is directed in the UK > > > > to > > > > those persons who are market counterparties or intermediate > > > customers > > > > (as defined in the UK Financial Services Authority's rules). > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > > > > The most comprehensive and flexible code editor you can use. > > > > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day > > > Trial. > > > > > > > > www.slickedit.com/sourceforge > > > > _______________________________________________ > > > > Quantlib-users mailing list > > > > [hidden email] > > > > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > ############################### DISCLAIMER > > > > ################################# > > > > > > > > This message (including any attachments) is confidential and may be > > > > privileged. If you have received it by mistake please notify the > > > > sender by > > > > return e-mail and delete this message from your system. Any > > > > unauthorised > > > > use or dissemination of this message in whole or in part is strictly > > > > prohibited. Please note that e-mails are susceptible to change. > > > Banca > > > > del > > > > Gottardo (including its group companies) shall not be liable for the > > > > improper or incomplete transmission of the information contained in > > > > this > > > > communication nor for any delay in its receipt or damage to your > > > > system. > > > > Banca del Gottardo (or its group companies) does not guarantee that > > > > the > > > > integrity of this communication has been maintained nor that this > > > > communication is free of viruses, interceptions or interference. > > > > > > > > > > > > > > > ########################################################################### > > > > > > -- > > > This is not an offer (or solicitation of an offer) to buy/sell the > > > securities/instruments mentioned or an official confirmation. Morgan > > > Stanley may deal as principal in or own or act as market maker for > > > securities/instruments mentioned or may advise the issuers. This may > > > refer to a research analyst/research report. Unless indicated, these > > > views are the author's and may differ from those of Morgan Stanley > > > research or others in the Firm. We do not represent this is accurate > > > or > > > complete and we may not update this. Past performance is not > > > indicative > > > of future returns. For additional information, research reports and > > > important disclosures, contact me or see https://secure.ms.com. You > > > should not use email to request, authorize or effect the purchase or > > > sale of any security or instrument, to send transfer instructions, or > > > to > > > effect any other transactions. We cannot guarantee that any such > > > requests received via email will be processed in a timely manner. > > > This > > > communication is solely for the addressee(s) and may contain > > > confidential information. We do not waive confidentiality by > > > mistransmission. Contact me if you do not wish to receive these > > > communications. In the UK, this communication is directed in the UK > > > to > > > those persons who are market counterparties or intermediate customers > > > (as defined in the UK Financial Services Authority's rules). > > > > > > > > > > -- > > Nicolas Di Césaré > > http://nicolas.dicesare.free.fr > > -- > This is not an offer (or solicitation of an offer) to buy/sell the > securities/instruments mentioned or an official confirmation. Morgan Stanley may > deal as principal in or own or act as market maker for securities/instruments > mentioned or may advise the issuers. This may refer to a research analyst/research > report. Unless indicated, these views are the author's and may differ from those of > Morgan Stanley research or others in the Firm. We do not represent this is accurate > or complete and we may not update this. Past performance is not indicative of > future returns. For additional information, research reports and important > disclosures, contact me or see https://secure.ms.com. You should not use email to > request, authorize or effect the purchase or sale of any security or instrument, to > send transfer instructions, or to effect any other transactions. We cannot > guarantee that any such requests received via email will be processed in a timely > manner. This communication is solely for the addressee(s) and may contain > confidential information. We do not waive confidentiality by mistransmission. > Contact me if you do not wish to receive these communications. In the UK, this > communication is directed in the UK to those persons who are market counterparties > or intermediate customers (as defined in the UK Financial Services Authority's > rules). > > ------------------------------------------------------- > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > The most comprehensive and flexible code editor you can use. > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. > www.slickedit.com/sourceforge > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users -- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com. You should not use email to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via email will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules). |
At 08:35 PM 2/20/03 +0000, Chak Jack Wong wrote:
>Hi, I propose to add two functions to the FloatingRateCoupon.hpp, I wonder >if people agree on that > >virtual Date fixingValueDate() const = 0; >virtual Date adjustedAccruedEndDate() const = 0; It's ok for me. The only thing is, I wonder if someone could come out with a clearer name than "adjustedAccrualEndDate". Also, maybe "adjustedFixingDate" would be more consistent? Later, Luigi |
Free forum by Nabble | Edit this page |