Re: pricing a floating rate bond

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/pricing-a-floating-rate-bond-tp14445p14453.html

On Sat, Jul 13, 2013 at 1:25 AM, Steve <[hidden email]> wrote:
> I am trying to price a floating rate bond that depends on the rate of a
> Treasury instrument. For simplicity, the rate and the date are imported from
> the file. But I used IborIndex class for the rate of the instrument.
> Unsurprisingly, the result is way off. So I have a few questions on this
> topic:
>
> 1 is there an equivalent index class for the Treasury instrument, like
> IborIndex for LIBOR, in QuantLib?

Not as such.  You might use IborIndex as a proxy, provided that the
conventions match; for instance, the LIBOR rate is simply compounded,
with an Actual/360 day-count convention in the case of USD LIBOR.  As
far as I know, T-bills are quoted as a discount; how is the rate of
your Treasury instrument derived from that?  And instead of looking at
the price of the bond (that is, at the sum of the coupons, which
muddies things), have you tried first looking at forecast IborIndex
fixings to see if they match the rates you expect?

> 2 if the answer is no, is it possible to build a class like TreasuryIndex by
> extending InterestRateIndex? What would be the challenge in building
> TreasuryIndex?

You would have to implement the forecastFixing method so that it
returns the T-Bill rate. Basically, you'd have to be able to forecast
the rate off your treasury curve. (You'd also have to implement the
maturityDate method, but that's easy).

> 3 Is it possible to use IborIndex for a Treasury instrument by tweaking the
> calendar alone? What else needs to be done to make it work?

See above. It depends on how much the conventions differ.

> 4      Can someone point me to the right direction on how to leverage
> QuantLib classes to price a floating rate bond that uses a Treasury
> instrument as the index after a peek at the code?

If using IborIndex fails, inheriting from InterestRateIndex shouldn't
be that difficult. Once you have a rate class, you should be able to
use the existing classes as you did in your code.

Let me know how it works.

Later,
    Luigi


--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users