Hi Leon, I've added an inflation-lined bond into the QL trunk, as CPIbond in ql/instruments/bonds/cpibond.cpp. If you look at the new test inflationcpiswap.cpp you'll see how it works - all comments/suggestions welcome. I've also added some other CPI-linked functionality e.g. CPI-swaps and a CPICapFloor Instrument (test is in inflationcpicapfloor.cpp). Regards, Chris On Thu, 2011-01-06 at 15:00 -0600, Leon Sit wrote: >> I am trying to implement Inflation Linked Gilt. Is there a general >> advice on what part of quantlib I can reuse? I think I can probably >> reuse InflationTermStructurem, InflationIndex, and Bond. Any >> implementation advice? >You'll probably want to inherit a class from Coupon that takes an >InflationIndex and uses it to implement its rate() and accruedAmount() >methods (possibly a ZeroInflationIndex. I find it easier to cope with; >the YoYInflationIndex is a bit more quirky about retrieving fixings.) >Once you have the coupon, you can inherit a class from Bond. The >constructor will assemble the correct cash flows. If you're lucky, that >would be all; if instead your bond price must be rescaled by some >inflation factor, you'll have to put that calculation somewhere. You >might override performCalculation to do the rescaling after calling the >base-class implementation. >Luigi ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Thanks tons! I will look into it and let you know.
I was implementing it for gilt and the day counting convention was terribly confusing. Leon On Sun, Jan 16, 2011 at 2:20 PM, Chris Kenyon <[hidden email]> wrote: > Hi Leon, > > I've added an inflation-lined bond into the QL trunk, as CPIbond in > ql/instruments/bonds/cpibond.cpp. > > If you look at the new test inflationcpiswap.cpp you'll see how it works - > all comments/suggestions welcome. > > I've also added some other CPI-linked functionality e.g. CPI-swaps and a > CPICapFloor Instrument (test is in inflationcpicapfloor.cpp). > > Regards, > > Chris > > On Thu, 2011-01-06 at 15:00 -0600, Leon Sit wrote: >>> I am trying to implement Inflation Linked Gilt. Is there a general >>> advice on what part of quantlib I can reuse? I think I can probably >>> reuse InflationTermStructurem, InflationIndex, and Bond. Any > >>> implementation advice? > >>You'll probably want to inherit a class from Coupon that takes an >>InflationIndex and uses it to implement its rate() and accruedAmount() >>methods (possibly a ZeroInflationIndex. I find it easier to cope with; >>the YoYInflationIndex is a bit more quirky about retrieving fixings.) > >>Once you have the coupon, you can inherit a class from Bond. The >>constructor will assemble the correct cash flows. If you're lucky, that >>would be all; if instead your bond price must be rescaled by some >>inflation factor, you'll have to put that calculation somewhere. You >>might override performCalculation to do the rescaling after calling the >>base-class implementation. > >>Luigi > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |