full price(dirty price) vs clean price

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

full price(dirty price) vs clean price

gigifaye29
Hello,

Can I verify the "price" as a parameter that feeds to various functions in Quantlib?

One of them is the cashflows::irr(const Leg &leg, Real marketPrice, ...)
Does the marktPrice here mean the clean price?
If it's a clean price,  would the irr result be huge in a case that, say, I have a semi-annually paid bond maturing in 10 days, with cash flow say 100+5 at that time(this would be the 'leg' in the irr function I assume) and the quoted price(market price) is 99.98(not including the acrrued) for instance ? (seems to me it's searching for root so that the npv(cashflow) would be equal to the price 99.98)

Also another one -similar kind of confusion :
FixedRateBondHelper (const Handle< Quote > &cleanPrice, Natural settlementDays,...)
It explicitly says 'cleanprice' here.  What if I push a bond in the example above as a rate helper to instruments that feeds the termstructure template, would that result in a weird yield?

Appreciate if you can shed lights on my concerns...

Thanks,
Xin
Reply | Threaded
Open this post in threaded view
|

Re: full price(dirty price) vs clean price

Luigi Ballabio
On Fri, 2008-05-23 at 07:25 -0700, gigifaye29 wrote:
> Can I verify the "price" as a parameter that feeds to various functions in
> Quantlib?
>
> One of them is the cashflows::irr(const Leg &leg, Real marketPrice, ...)
> Does the marktPrice here mean the clean price?

No; looking at the code, it is the dirty price. It should be better
documented to avoid confusion.

> Also another one -similar kind of confusion :
> FixedRateBondHelper (const Handle< Quote > &cleanPrice, Natural
> settlementDays,...)
> It explicitly says 'cleanprice' here.  What if I push a bond in the example
> above as a rate helper to instruments that feeds the termstructure template,
> would that result in a weird yield?

No, the yield will be ok. The rate helper knows that the input is a
clean price and performs the calculations accordingly (i.e., it will
search for a root such that the bond's clean price equals the input.)

Luigi



--

Anyone who says he can see through women is missing a lot.
-- Groucho Marx



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users