Amortizing Floating Rate Bonds

import QuantLib as ql import pandas as pd # 1. Setup Evaluation Date and Market Curve today = ql.Date(23, 6, 2026) ql.Settings.instance().evaluationDate = today # Flat forward curve for forecasting and discounting rate_handle = ql.RelinkableYieldTermStructureHandle() rate_handle.linkTo(ql.FlatForward(today, 0.04, ql.Actual360())) # 2. Define Amortizing Notional and Schedule notionals = [10000.0, 7500.0, 5000.0, 2500.0] # Principal reduces over time start_date = ql.Date(23, 6, 2026) end_date = ql.Date(23, 6, 2028) # 2-year term schedule = ql.MakeSchedule( effectiveDate=start_date, terminationDate=end_date, frequency=ql.Semiannual, # Semiannual coupons calendar=ql.TARGET(), convention=ql.Following, backwards=True ) # 3. Create IBOR Index and set an initial fixing index = ql.Euribor6M(rate_handle) index.addFixing(ql.Date(23, 12, 2025), 0.035) # Add past fixing for the first coupon # 4. Construct the Amortizing Floating Rate Bond settlement_days = 2 day_counter = ql.Actual360() bond = ql.AmortizingFloatingRateBond( settlement_days, notionals, schedule, index, day_counter )