简体   繁体   中英

How to structure Fixed Rate cashflows with monthly interest rate compounded and paid Quarterly

I am using Quantlib swig implementatin in python. I am trying to model some loan agreements with fixed interest rate which is calculated monthly on simple basis and compounded quarterly basis. Example Issue Date March 18, 2011

First stub April 1, 2011

Second interest date july 1, 2011

Next interest payment dates every quarter after that October 1 and so on.

Coupon 8.45% calculated on simple basis and compounded every quarter.

I am unable to strcuture the flows using FixedRateLeg or FixedRateBond functions.

I notice that in C++ code there is an option to use FixedRateLeg with couponRates. I can provide Interest rate class with compounding of SimpleThenCompounded. But I think this function override is not available in Python swig version.

Any solutions as to how I can solve this ?

For the dates, genereting what you want it pretty easy since if nothing is defined, the stub will be at the beggining:

issueDate = ql.Date(18,3,2011)
maturityDate = ql.Date(1, 10, 2021)

schedule = ql.MakeSchedule(issueDate, maturityDate, ql.Period('3M'))

for date in [*schedule][:5]:
    print(date.ISO())

2011-03-18
2011-04-01
2011-07-01
2011-10-01
2012-01-01

As for the rate, I'm not sure you mean by compounding quarterly if payments are quarterly. The ql.SimpleThenCompounded convention is used for example for TBills that might have more that one year, where the rate convention will be simple until one year and compounded for over a year.

Are you sure this won't give you what you want?

dayCount = ql.Actual360()
leg = ql.FixedRateLeg(schedule, dayCount, [100.], [0.0845])
for cf in leg:
    print(cf.date().ISO(), cf.amount())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM