2
$\begingroup$

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
$\endgroup$
5
  • $\begingroup$ Could you share the spotDates and spotRates? $\endgroup$ Jan 4 at 9:07
  • $\begingroup$ My program has 9/30/2022 as time zero. spotDates is just the date vector at monthly interval that goes out to 100 years. Since it's 5% flat I don't expect the date vector to matter in this case. $\endgroup$
    – Jessica
    Jan 5 at 15:34
  • $\begingroup$ A follow up simplified test. This time I constructed flat 5% curve as simple annual. The Forward rate for some reason becomes 3.432548 % Actual/360 simple compounding. It doesn't seem right... $\endgroup$
    – Jessica
    Jan 10 at 16:03
  • $\begingroup$ 'A follow up simplified test. This time I constructed flat 5% curve as simple annual. The Forward rate for some reason becomes 3.432548 % Actual/360 simple compounding. It doesn't seem right.. flatZero5 = ql.ZeroCurve([ql.Date(30,9,2022), ql.Date(30,9,2042)], [0.05,0.05], ql.Actual360(), ql.UnitedStates(), ql.Linear(), ql.Simple, ql.Annual) flat5handle = ql.YieldTermStructureHandle( flatZero5) ' $\endgroup$
    – Jessica
    Jan 10 at 16:04
  • $\begingroup$ ' print( flat5handle.forwardRate( ql.Date(30,9,2032), ql.Date(30,9,2033), ql.Actual360(), ql.Simple, ql.Annual) )' $\endgroup$
    – Jessica
    Jan 10 at 16:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.