I'm beginner in quantlibxl and I'm doing Marco Marchioro's lecture 2 IRS-Floating-leg Sheet's exercise.
Here is my question:
When I use the given example, the both npvs(qunatlib calculation and excel calculation ) work.
But if I change the pricing date, after the effective date, the qllegNPV gives the error message(#NUM). How do I fix it?
The following is term sheet schedule:
Pricing date: 10/30/2015
Effective date: 07/23/2015
Terminate date: 7/23/2022
Tenor: 3M
I try my best to explain my function in excel
To build the cash flow schedule(irs-float-schedule#0000):
=qlSchedule(irs-float-schedule,7/23/2015,7/23/2022,3M,TARGET,Modified Following,Modified Following,Forwad,TRUE,,,,)
Forecast curve(swp-forecast#0000)
=qlFlatForward(swp-forecast,0,TARGET,0.29%,Actual/360,Continous,SemiAnnual,,)
Libor Index(euribor#0000)
=qlEuribor(euribor,3M,swp-forecast#0000,,)
Discount curve(swp-discount#0000):
=qlFlatForward(swp-discount,0,TARGET,4%,Actual/360,Continous,SemiAnnual,,)
IRS Floating leg(irs-float-leg#0000):
=qlIborLeg(irs-float-leg,Following,5000000,irs-float-schedule#0000,,,Actual/360,0,1,euribor,0,0,,)
legNPV:
=qlLegNPV(irs-float-leg#0000,swp-discount#0000)
Thanks for your help.