|
From: Luigi B. <lui...@gm...> - 2021-11-17 09:18:13
|
Hello Goutham,
IborLeg will build all the coupons, because you're passing the whole
schedule, but when you then pass the resulting leg to a function like
CashFlows::npv() it will only take into account the ones that still have to
be paid.
Hope this helps,
Luigi
On Tue, Nov 16, 2021 at 9:54 PM Goutham Mahesh <gou...@gm...>
wrote:
> Hi All,
>
> This is the scenario:
>
> I have computed the floating leg for and IRS as follows:
> floatingleg = IborLeg(data, SwapSchedule, index, Actual360(),
> ModifiedFollowing, fixingDays=[0], gearings=[1], spreads = [0])
>
> The SwapSchedule is a schedule set for 3 years with quarterly payments,
> therefore there are 12 floating leg payments for the swap.
>
> "data" is a list of 12 nominals for each of the 12 floating leg cash flows
> .
> data = [1000000, 1000000, 1000000, 1000000, 1000000, 869565, 739130,
> 608695, 478260, 347826, 217391, 86956]
>
> Let us say now that 1 year and 4 cash flow dates have passed. I have to
> re-calculate the floating leg.
> The "data" list now has 8 nominals to reflect the 8 remaining cash flow
> dates.
> data = [1000000, 869565, 739130, 608695, 478260, 347826, 217391, 86956]
>
> My doubt is regarding how to recalculate my floating leg, and if I should
> use a new SwapSchedule or a new index.
>
> For building the SwapSchedule I have currently used the original
> date(old_date) and original maturity_date because I do not want the cash
> flow dates to change.
>
> As for the index I have done:
> Settings.instance().evaluationDate = new_date
> I have built the index using the methodology in the python cookbook
> quantlib IRS example.
>
> The code is running in this situation but the floating leg is still
> returning 12 cash flows, whereas I want to return only 8 cash flows to
> reflect the 8 remaining payments of the floating leg.
>
> --
>
> Any help will be appreciated as I have been trying really hard to figure
> this problem out. If you require more info as to how I built the index I
> will send that as well.
>
> Thank you,
> Goutham
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|