Re: VanillaSwap evaluation between effective andtermination date

Posted by YuHong-4 on
URL: http://quantlib.414.s1.nabble.com/VanillaSwap-evaluation-between-effective-and-termination-date-tp383p390.html

 
Would you have a sample with relevant data?  For many issues with QuantLib, guess can work out the math first, and then check the code.
 
Regards,
 
Hong Yu
 
 
 
Sent: Monday, June 20, 2011 6:42 PM
Subject: [Quantlib-users] VanillaSwap evaluation between effective andtermination date
 

Hi,

I am trying to calculate NPV of a vanilla swap based in the swapvaluation.cpp code.

I have setup the swap the following way :

Effective time : 2010-10-01

Termination time : 2020-10-01

Evaluation date is June 20, 2011 which will have a settlement date on June 22, 2011. The rates used are :

USDLibor BBA depo rates from ON to 12 months and several swap rates from 2 years to 30 years. The fixed payment frequency is annual and floating is semiannual. The calendar used is TARGET. As shown here the difference is the evaluation date is between the swap’s effective and termination dates. So when I came to construct the VanillaSwap, what should I pass for the effective date parameter for the fixed and floating schedules if the date generation rule is Forward?  If I pass June 22, then the payment dates thus generated will be different from the original schedule. So I pass the original effective date 2010-10-01 as effective date. But with this setting, I got an exception in DiscountingSwapEngine::calculate() when it discounts on each cash flow’s startDate like startDiscounts[i] = discountCurve_->discount(d) because timeFromReference  (referernce date is June 22, 2011) will be negative. So what is this startDiscounts are used for in the first place and what should one setup to evaluate a VanillaSwap on a date between its effective and termonation time. Should one pass as effective date of the schedule the immediate cach flow date that is later than the settlement date (June 22, 2011, this is case)?

 

Jicun


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev


_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users