Login  Register

Re: Irritated about dates in DiscountingSwapEngine

Posted by Henner Heck on Jan 27, 2011; 2:26pm
URL: http://quantlib.414.s1.nabble.com/Irritated-about-dates-in-DiscountingSwapEngine-tp12035p12038.html


Hello,

@Ferdinando:
Correct me if i am wrong:
I make a swap contract at 26.1., the swap has a fixing offset of two days,
so it actually starts at 28.1.. If i want to evaluate the swap for 28.1.,
i would take the newest market data i have from the 26.1. and use it to build
a discount curve and forecast curve with 26.1. as reference date.
I'd forecast the floating leg fixings and then use the discount curve to discount
all cashflows to the 26.1. and finally discount the sum of these discounted cashflows to the 28.1..
So in the CashFlows::npv function my SettlementDate and my npvDate would be the 28.1.,
which is not identical with my discountcurve reference date, the 26.1..
If i interpret the official QuantLib swap example correctly, the way to do it with the DiscountingSwapEngine's
constructor using only the discountCurve parameter would be to set the curve's reference date to 28.1. and
thereby implicitly set SettlementDate and npvDate to the same date which introduces a slight difference by
discounting to the 28.1. directly with a curve moved two days into the future.

Also if wanted to forecast the value of a swap at different dates during it's life
using today's market data (whether it makes sense or not :) ), the SettlementDate
and npvDate would have to be different from the curve's reference date and further
into the future than it.

The patch gives me the freedom i needed,
so at the moment everything's fine.  :)

@Luigi
Thank you for the patch. Will it be in future official releases?
The line
"%feature("kwargs") DiscountingSwapEnginePtr;"
is for Python compatibility, if i am correct, but it has the effect,
that only the constructor with all possible parameters is available in the Java class.
This of course breaks code which uses the previously available "discountCurve-only" constructor
from Java. I don't mind, just wanted to bring it to attention.

Best regards,
Henner Heck





Am 25.01.2011, 13:18 Uhr, schrieb Luigi Ballabio <[hidden email]>:

> On Tue, 2011-01-25 at 13:05 +0100, Ferdinando Ametrano wrote:
>> > I would appreciate any help getting the full
>> > constructor of
>> > DiscountingSwapEngine (discountCurve, includeSettlementDateFlows,
>> > settlementDate, npvDate)
>> > to work in SWIG or to evaluate a VanillaSwap without
>> > using DiscountingSwapEngine.
>>
>> this is a legitimate request. I'm pretty sure Luigi will oblige to it.
>
> The patch is in the mail. I mean, it's attached.
>
> Also, I confess I didn't fully understand your setup; but if you want
> the reference date of the curve to follow the evaluation date, you can
> instantiate the curve by passing a number of settlement days (possibly
> 0) and a calendar (possibly NullCalendar) instead of a fixed settlement
> date. If you do so, the reference date of the curve will change when the
> evaluation date does.
>
> Luigi
>
>


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev