Date

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

Date

Ben-163
Hi,

Im currently working on a bond class, which I'll mail to this list when
completed.  I was wondering what is the best way to deal with dates.  At
any given time, the current date matters (for instance with regards to
calculating NPV.)

Im also working on a seperate 'engine' for DV01 hedging, mainly as an
educational exercise, but i was wondering if this was something which
could perhaps be included?

Regards
Ben



--
Ben
[hidden email]




Reply | Threaded
Open this post in threaded view
|

Re: Date

Ferdinando M. Ametrano-2
Hi Ben

>Im currently working on a bond class, which I'll mail to this list when
>completed.  I was wondering what is the best way to deal with dates.  At
>any given time, the current date matters (for instance with regards to
>calculating NPV.)
My 0.2$: yes, the current date matters for pricing, but does not belong to
the bond class itself.
The current date is already contained by any term structure instance, it
could be provided as input to a duration() method, but should not be a data
member.

>Im also working on a seperate 'engine' for DV01 hedging, mainly as an
>educational exercise, but i was wondering if this was something which
>could perhaps be included?
It is of interest, but once again I wouldn't like it linked to the bond class.
In a more general framework there could be specialized hedging objects able
to perform hedge analysis on a given instrument (or deal, or portfolio)
using a given curve

Looking forward to your contribution

ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

Re: Date

Luigi Ballabio-4
In reply to this post by Ben-163
Hi Ben and everybody,

At 10:46 AM 2/8/02 +0000, Ben wrote:
>Im currently working on a bond class, which I'll mail to this list when
>completed.  I was wondering what is the best way to deal with dates.  At
>any given time, the current date matters (for instance with regards to
>calculating NPV.)

Great!
If I get your meaning, the current date (i.e., the one the "present" in NPV
refer to) is available from the discount curve as
TermStructure::todaysDate(). You can have a look at
QuantLib::Instruments::Swap to see how the discounting is done.

>Im also working on a seperate 'engine' for DV01 hedging, mainly as an
>educational exercise, but i was wondering if this was something which
>could perhaps be included?

Nando?

Bye,
         Luigi