I'm building a curve which has O/N, T/N, S/N, a few deposit rates (1,3,6,9,12 m) and a few swap rates (2,5,10 y). I'm using PiecewiseYieldcurve and I am setting the settlement date equal to today's date.
My question is, when I calculate the NPV of an existing swap (say it has plus or minus 7 years remaining), I assume it calculates the NPV to the settlement date of the curve, i.e. today. However, if I wanted to cancel that swap trade, there would be a cash settlement 2 days from today. So could anyone explain how to calculate the value 2 days from today using the above defined curve (I don't need the PV to today's date, but to today + 2)? ------------------------------------------------------------------------- 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 |
Hi Nathan
On Wed, May 28, 2008 at 5:04 PM, Nathan Abbott <[hidden email]> wrote: > I'm using > PiecewiseYieldcurve and I am setting the settlement date equal to today's > date. > > My question is, when I calculate the NPV of an existing swap (say it > it calculates the NPV to the settlement date of the curve, i.e. today. > [...] how to calculate the value 2 days from today using the > above defined curve (I don't need the PV to today's date, but to today + 2)? just divide the NPV as seen from today's date by the discount factor at todays+2. Anyway your question raises huge perplexity about your understanding of what is a "present value". My suggestion is to get any decent book and study the basics. ciao -- Nando ------------------------------------------------------------------------- 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 |
I know that is a way to get to the NPV, but I was wondering if there is either a method on the curve or the instrument which defines what date you want the cash flows to be discounted to.
On Wed, May 28, 2008 at 9:04 AM, Ferdinando Ametrano <[hidden email]> wrote: Hi Nathan ------------------------------------------------------------------------- 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 |
In reply to this post by Nathan Abbott
On Wed, 2008-05-28 at 08:04 -0700, Nathan Abbott wrote:
> I'm building a curve which has O/N, T/N, S/N, a few deposit rates > (1,3,6,9,12 m) and a few swap rates (2,5,10 y). I'm using > PiecewiseYieldcurve and I am setting the settlement date equal to > today's date. > > My question is, when I calculate the NPV of an existing swap (say it > has plus or minus 7 years remaining), I assume it calculates the NPV > to the settlement date of the curve, i.e. today. Correct. > However, if I wanted to cancel that swap trade, there would be a cash > settlement 2 days from today. So could anyone explain how to calculate > the value 2 days from today using the above defined curve (I don't > need the PV to today's date, but to today + 2)? As already suggested, you can do it manually. However, there are a couple of alternatives. One is to set the reference date of the curve to today + 2 (you'll have to drop the O/N and T/N rates.) The other (which is probably the best one if you want your curve to start from today) is to instantiate an ImpliedTermStructure with your curve as the underlying curve and today+2 as the reference date, and pass the implied curve to the swap pricing engine instead of the original one. Luigi -- Lubarsky's Law of Cybernetic Entomology: There is _always_ one more bug. ------------------------------------------------------------------------- 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 |
Hi Luigi, thanks very much for your reply. This is really
helpful. This way I can set up one master curve (starting today) and derive
other curves off of it with the appropriate settlement dates (T+2, T+3) I guess
the way I phrased my original question did not clearly state that I
was looking for something other than the obvious manual method
:-)
On a related note, if one were to do this manually,
one would have to adjust every single NPV calculation to adjust it for the
correct settlement date one wants on a particular instrument. Anybody ever think
about/suggest having the NPV functions accept an optional date
parameter where if no date is entered it will value through the curve
settlement date (as it does now) and if one does enter a date it adjusts
the value to that -settlement- date (effectively centralizing the 'manual'
discount factor adjustment)? On Thu, May 29, 2008 at 1:39 AM, Luigi Ballabio <[hidden email]> wrote:
------------------------------------------------------------------------- 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 |
On Thu, 2008-05-29 at 11:50 -0700, Nathan Abbott wrote:
> Anybody ever think about/suggest having the NPV functions accept an > optional date parameter where if no date is entered it will value > through the curve settlement date (as it does now) and if one does > enter a date it adjusts the value to that -settlement- date > (effectively centralizing the 'manual' discount factor adjustment)? If it were just the discount adjustment, it could be centralized; but there might be more issues---such as what should happen when the passed settlement date goes past a future coupon or exercise date. That should be explicitly managed in each instrument. Luigi -- An ideal world is left as an exercise to the reader. -- Paul Graham ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |