|
From: Luigi B. <lui...@gm...> - 2010-03-03 11:23:11
|
On Wed, 2010-03-03 at 09:41 +0100, Ferdinando Ametrano wrote: > On Tue, Mar 2, 2010 at 9:21 PM, Nathan Abbott <nka...@gm...> 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 |