Hello everyone,
I have a floating rate bond that I am trying to price. I did it with Quantlib first, and then with Bloomberg to check my results (it is a real bond, not just an example). I don't find the same results at all: the coupons are very different. That's because Quantlib calculates the future coupons based on the forward rates implied by the term structure, while Bloomberg uses the spot underlying index value as the assumed rate for the second and future index fixings. To illustrate, let me show you the cash flows I get. With Quantlib : Coupons_Quantlib.PNG With Bloomberg : Coupons_bloom.JPG I know that using the forward rates is a good way to do it, but I'd still like to give the user the choice between the two methods. Is there any way in Quantlib to set my future (undetermined) floating coupons to a fixed value like Bloomberg does (= (underlying spot rate + spread)*coupon frequency)? If not, how should I do it? Thank you for your help |
Hi MDecau,
As far as I know, there is no obvious way to do the same as BBG do in quantlib. However you can adjust the QL source code to meet your requirement anyway. Some thoughts about the idea: 1. To make coupon fix at a given date (e.g. in your case, the spot date) is to adjust the behavior of the member function ``fixingDate``of ``FloatingRateCoupon``. IMO you can added a stored member of flag or a known date in ``FloatingRateCoupon``to indicate that you want the coupon to be fixed at that given date. 2. Most of pricing logic is done in a specific pricing engine for a specific product. After you have finished the above change, you can write up your own pricing engine to leverage the feature you have added. The template engine you can consult to is the ``DiscountingBondEngine``. Regards, Cheng -----邮件原件----- 发件人: MDecau [mailto:[hidden email]] 发送时间: 2015年4月15日 16:24 收件人: [hidden email] 主题: [Quantlib-users] How to fix future (unknown) coupons of a FRN? Hello everyone, I have a floating rate bond that I am trying to price. I did it with Quantlib first, and then with Bloomberg to check my results (it is a real bond, not just an example). I don't find the same results at all: the coupons are very different. That's because Quantlib calculates the future coupons based on the forward rates implied by the term structure, while Bloomberg uses the spot underlying index value as the assumed rate for the second and future index fixings. To illustrate, let me show you the cash flows I get. With Quantlib : Coupons_Quantlib.PNG <http://quantlib.10058.n7.nabble.com/file/n16484/Coupons_Quantlib.PNG> With Bloomberg : Coupons_bloom.JPG <http://quantlib.10058.n7.nabble.com/file/n16484/Coupons_bloom.JPG> I know that using the forward rates is a good way to do it, but I'd still like to give the user the choice between the two methods. Is there any way in Quantlib to set my future (undetermined) floating coupons to a fixed value like Bloomberg does (= (underlying spot rate + spread)*coupon frequency)? If not, how should I do it? Thank you for your help -- View this message in context: http://quantlib.10058.n7.nabble.com/How-to-fix-future-unknown-coupons-of-a-F RN-tp16484.html Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Can you just set up a second bond with gearing = 0 and spread =
today's fixing for all coupons with fixing date >= today (if I understood the method correctly) ? Another idea would be to link the float index to a flat yts that produces the desired forecasts. However this is not as trivial as it looks, if one wants precise forecasts. Is it ? Finally, you could inherit from the float index (e.g. Euribor) and overwrite the forecastFixing method such that a given constant is returned. Peter On 15 April 2015 at 11:38, Cheng Li <[hidden email]> wrote: > Hi MDecau, > > As far as I know, there is no obvious way to do the same as BBG do in > quantlib. However you can adjust the QL source code to meet your requirement > anyway. > > Some thoughts about the idea: > > 1. To make coupon fix at a given date (e.g. in your case, the spot date) is > to adjust the behavior of the member function ``fixingDate``of > ``FloatingRateCoupon``. IMO you can added a stored member of flag or a known > date in ``FloatingRateCoupon``to indicate that you want the coupon to be > fixed at that given date. > > 2. Most of pricing logic is done in a specific pricing engine for a specific > product. After you have finished the above change, you can write up your own > pricing engine to leverage the feature you have added. The template engine > you can consult to is the ``DiscountingBondEngine``. > > Regards, > Cheng > > -----邮件原件----- > 发件人: MDecau [mailto:[hidden email]] > 发送时间: 2015年4月15日 16:24 > 收件人: [hidden email] > 主题: [Quantlib-users] How to fix future (unknown) coupons of a FRN? > > Hello everyone, > > I have a floating rate bond that I am trying to price. I did it with > Quantlib first, and then with Bloomberg to check my results (it is a real > bond, not just an example). I don't find the same results at all: the > coupons are very different. > That's because Quantlib calculates the future coupons based on the forward > rates implied by the term structure, while Bloomberg uses the spot > underlying index value as the assumed rate for the second and future index > fixings. > > To illustrate, let me show you the cash flows I get. > With Quantlib : > Coupons_Quantlib.PNG > <http://quantlib.10058.n7.nabble.com/file/n16484/Coupons_Quantlib.PNG> > With Bloomberg : > Coupons_bloom.JPG > <http://quantlib.10058.n7.nabble.com/file/n16484/Coupons_bloom.JPG> > > I know that using the forward rates is a good way to do it, but I'd still > like to give the user the choice between the two methods. Is there any way > in Quantlib to set my future (undetermined) floating coupons to a fixed > value like Bloomberg does (= (underlying spot rate + spread)*coupon > frequency)? > If not, how should I do it? > > Thank you for your help > > > > -- > View this message in context: > http://quantlib.10058.n7.nabble.com/How-to-fix-future-unknown-coupons-of-a-F > RN-tp16484.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > ---------------------------------------------------------------------------- > -- > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your > own process in accordance with the BPMN 2 standard Learn Process modeling > best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thank you both for your valuable answers. I worked on them yesterday.
Cheng, I understood what was your idea and I tried to implement it, but I did not succeed, probably because I'm not (yet) familiar enough with Quantlib internal design to modifiy it. And Peter, I did your first method (with gearing = 0 and spread = today's fixing), which was a smart workaround. It works well. But I still don't get the exact same coupons as Bloomberg: Bloomberg changes the day counting convention when it fixes its rates. For example, in my screenshot it has an Actual 360 convention until the 17/04/2015, and then it becomes a Thirty 360 convention. I cannot see any reason for that. I did not have to try your other ideas, despite that the last one seemed also a good way of doing it. Thank you again Marin |
Oh my good. If this is the convention, you would certainly need a
special pricing engine for this. Who comes up with such things? Peter On 17 April 2015 at 08:50, MDecau <[hidden email]> wrote: > Thank you both for your valuable answers. I worked on them yesterday. > > Cheng, I understood what was your idea and I tried to implement it, but I > did not succeed, probably because I'm not (yet) familiar enough with > Quantlib internal design to modifiy it. > > And Peter, I did your first method (with gearing = 0 and spread = today's > fixing), which was a smart workaround. It works well. But I still don't get > the exact same coupons as Bloomberg: Bloomberg changes the day counting > convention when it fixes its rates. For example, in my screenshot it has an > Actual 360 convention until the 17/04/2015, and then it becomes a Thirty 360 > convention. I cannot see any reason for that. > I did not have to try your other ideas, despite that the last one seemed > also a good way of doing it. > > Thank you again > Marin > > > > -- > View this message in context: http://quantlib.10058.n7.nabble.com/How-to-fix-future-unknown-coupons-of-a-FRN-tp16484p16493.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
BBg is legendarily buddy : ) On Fri, 17 Apr 2015 at 17:53 Peter Caspers <[hidden email]> wrote:
Oh my good. If this is the convention, you would certainly need a ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
*buggy On Fri, 17 Apr 2015 at 18:03 John Orford <[hidden email]> wrote:
------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Peter Caspers-4
The market qoutation convention for pricing frn is a closed form formula
which requires 1) all periods are of equal length and 2) the rate for future coupons is fixed. That is probably why the 30360 convention comes into play after next coupon i.e. it does not mean that the daycount is changing. Regards, Magnus Nystrom Algorithmica Research AB > -----Original Message----- > From: Peter Caspers [mailto:[hidden email]] > Sent: Friday, April 17, 2015 11:51 AM > To: MDecau > Cc: QuantLib users > Subject: Re: [Quantlib-users] 答复: How to fix future (unknown) coupons of a > FRN? > > Oh my good. If this is the convention, you would certainly need a special pricing > engine for this. Who comes up with such things? > Peter > > > On 17 April 2015 at 08:50, MDecau <[hidden email]> > wrote: > > Thank you both for your valuable answers. I worked on them yesterday. > > > > Cheng, I understood what was your idea and I tried to implement it, > > but I did not succeed, probably because I'm not (yet) familiar enough > > with Quantlib internal design to modifiy it. > > > > And Peter, I did your first method (with gearing = 0 and spread = > > today's fixing), which was a smart workaround. It works well. But I > > still don't get the exact same coupons as Bloomberg: Bloomberg changes > > the day counting convention when it fixes its rates. For example, in > > my screenshot it has an Actual 360 convention until the 17/04/2015, > > and then it becomes a Thirty 360 convention. I cannot see any reason for > > I did not have to try your other ideas, despite that the last one > > seemed also a good way of doing it. > > > > Thank you again > > Marin > > > > > > > > -- > > View this message in context: > > http://quantlib.10058.n7.nabble.com/How-to-fix-future-unknown-coupons- > > of-a-FRN-tp16484p16493.html Sent from the quantlib-users mailing list > > archive at Nabble.com. > > > > ---------------------------------------------------------------------- > > -------- BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > > Develop your own process in accordance with the BPMN 2 standard Learn > > Process modeling best practices with Bonita BPM through live exercises > > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > > event?utm_ > > > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign > =VA_SF > > _______________________________________________ > > QuantLib-users mailing list > > [hidden email] > > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > -- > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your > own process in accordance with the BPMN 2 standard Learn Process modeling > best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign > =VA_SF > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Ok Magnus, this might explain it indeed. I will see if I can change my code to take this into account, but as Peter said, I will probably have to use a new pricing engine.
I know John, especially buggy this morning if you see what I mean... |
If you do write a new engine, please consider contributing it. Luigi On Fri, Apr 17, 2015 at 2:59 PM, MDecau <[hidden email]> wrote: Ok Magnus, this might explain it indeed. I will see if I can change my code ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |