I think I have a need for another pricing engine for the bond instrument

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

I think I have a need for another pricing engine for the bond instrument

Nathan Abbott

I think I have a need for another pricing engine for the bond instrument. My users want to place bond in a portfolio that contains different type of instruments. Right now, I place all the instruments in a collection and then loop through the collection and call the NPV method of each instrument. The problem is that the user wants the NPV of the bond to be the amount purchased * clean price  / 100.  I am thinking the best way to solve this problem is to create another pricing engine for the bond that calculates the NPV of the bond to equal the amount purchased * the clean price / 100.  Is this a common proiblem? If I wrote the engine, would people want it include in QuantLib?


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: [Quantlib-dev] I think I have a need for another pricing engine for the bond instrument

Ferdinando M. Ametrano-3
On Tue, Mar 2, 2010 at 9:21 PM, Nathan Abbott <[hidden email]> wrote:
> the user wants the NPV of the bond to be the amount
> purchased * clean price  / 100.

and you know what... he's simply right

The current engine does calculate the dirty price
(results_.settlementValue) and some "npv" (results_.value) of
questionable usefulness. My reservation about the current npv are:
1) it does include cashflows before or on bond settlement date, which
in most situation do not belong to the npv
2) is valid for an holding amount of faceAmount (typically 100)

> I am thinking the best way to solve this
> problem is to create another pricing engine for the bond that calculates the
> NPV of the bond to equal the amount purchased * the clean price / 100.

the real issue in not the engine, but the current lack for the
"holding amount" piece of info
I would put it in the Bond class since it inherits from Instrument and
so it should be homogeneous to other Instruments in portfolio
evaluation.

Luigi?

ciao -- Nando

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: [Quantlib-dev] I think I have a need for another pricing engine for the bond instrument

Luigi Ballabio
On Wed, 2010-03-03 at 09:41 +0100, Ferdinando Ametrano wrote:
> On Tue, Mar 2, 2010 at 9:21 PM, Nathan Abbott <[hidden email]> wrote:
> > the user wants the NPV of the bond to be the amount
> > purchased * clean price  / 100.
>
> and you know what... he's simply right

Is he?  So if I'm holding a bond, the fraction of the current coupon
that I have already accrued is not part of its value?


> The current engine does calculate the dirty price
> (results_.settlementValue) and some "npv" (results_.value) of
> questionable usefulness. My reservation about the current npv are:
> 1) it does include cashflows before or on bond settlement date, which
> in most situation do not belong to the npv

That's on purpose.  settlementValue() and NPV() answer two different
questions.  The first is "how much money am I going to make if I sell
this bond?"  The second is "how much money am I going to receive if I
keep this bond until its maturity?"  I'd say they're both legitimate,
even if questionably useful :)  I can see that one might want to have
one or the other as the instrument NPV---or neither, as Nathan's user
wants to exclude the accrued amount.

(While we discuss which is more sensible, a simple solution for Nathan
might be to wrap the bond, i.e., write a simple instrument that takes a
Bond instance and whose NPV is calculated from the bond as the amount
purchased * clean price  / 100.)

> 2) is valid for an holding amount of faceAmount (typically 100)
>
> > I am thinking the best way to solve this
> > problem is to create another pricing engine for the bond that calculates the
> > NPV of the bond to equal the amount purchased * the clean price / 100.
>
> the real issue in not the engine, but the current lack for the
> "holding amount" piece of info
> I would put it in the Bond class since it inherits from Instrument and
> so it should be homogeneous to other Instruments in portfolio
> evaluation.

I'm not sure I get it.  Wouldn't it be the same as putting in a Stock
class the number of stocks held?  If we're modeling an instrument
(singular) how many we have is an external information.  No?

Later,
        Luigi


--

The wisdom of the wise and the experience of the ages are perpetuated
by quotations.
-- Benjamin Disraeli



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: [Quantlib-dev] I think I have a need for another pricing engine for the bond instrument

Nathan Abbott
Thank you for the replies.


 While we discuss which is more sensible, a simple solution for Nathan
 might be to wrap the bond, i.e., write a simple instrument that takes a
 Bond instance and whose NPV is calculated from the bond as the amount
 purchased * clean price  / 100.)

That was my original idea. I am going to start working on it right now. Is that something that would be included in QuantLib?


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users