• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

IRS Floating Leg Cash Flow Computation at a Later Date

Joined
9/16/19
Messages
7
Points
11
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 re-calculate my floatingleg, 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 floatingleg is still returning 12 cash flows, whereas I want to return only 8 cashflows 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 anyone needs more info as to how I built the index I will post that as well.

Thank you,
Goutham
 
Back
Top