I am struggling to reconcile the cashflow of a floating rate bond. I created a reference index of 5% flat, then a bond that pays quarterly coupon with Actual/360. For example, I'd expect the coupon on 4/15/2023 (accrual from 1/15-4/15) to be 90/360*5%*100 = 1.25 exactly. Maybe it needs to be converted from continuous to simple. (exp(0.05/4)-1)*100 gives me 1.257845. Quantlib returns 1.2579326904575874. Where did this come from?
flatZero5 = ql.ZeroCurve(spotDates,
pd_zero_curve['Value']*0 +0.05,
ql.Actual360(),
ql.UnitedStates(),
ql.Linear(),
ql.Continuous,
ql.NoFrequency)
flat5handle = ql.YieldTermStructureHandle( flatZero5 )
index1 = ql.USDLibor(ql.Period(3, ql.Months),
ql.RelinkableYieldTermStructureHandle(flatZero5)
)
index1.addFixings( [ql.Date(13,1,2022),ql.Date(13,4,2022),ql.Date(13,7,2022)], [0.05,0.05,0.05] )
schedule = ql.MakeSchedule(ql.Date(15,1,2022), ql.Date(15,1,2042) , ql.Period('3M'))
bond1 = ql.FloatingRateBond(settlementDays=3,
faceAmount = 100,
schedule = schedule ,
index = index1,
paymentDayCounter = ql.Actual360(),
spreads = [0]
)
bond_cf= bond1.cashflows()
print ( bond_cf[4].date() ) # April 15th, 2023
print ( bond_cf[4].amount() ) # result 1.2579326904575874
print( flat5handle.forwardRate( ql.Date(15,1,2023),
ql.Date(15,4,2023),
ql.Actual360(),
ql.Continuous,
ql.NoFrequency) ) # returns 5.000000 % Actual/360 continuous compounding