I got to bootstrap the OIS and Libor 3M swap curves, and now I'd like to valuate some simple Libor3M - Fix IRS with QuantLib (in python). My problem is that some of the instruments I have to valuate have custom amortization structure. Are there any examples on how to valuate a swap with a custom amortization schedule?
To value a Swap with amortizations, you can feed a vector (list in python) with the notionals.
calendar = ql.TARGET() start = ql.Date(17,6,2019) maturity = calendar.advance(start, ql.Period('2y')) fixedSchedule = ql.MakeSchedule(start, maturity, ql.Period('1Y')) fixedLeg = ql.FixedRateLeg(fixedSchedule, ql.Actual360(), [100, 50], [0.01]) floatSchedule = ql.MakeSchedule(start, maturity, ql.Period('6M')) floatLeg = ql.IborLeg([100, 100, 50, 50], floatSchedule, ql.Euribor6M(), ql.Actual360()) swap = ql.Swap(fixedLeg, floatLeg)