|
From: Mike D. <mik...@gm...> - 2021-03-26 02:06:33
|
Hi there. Try using: ql.ActualActual(ql.ActualActual.ISMA) That should work for UST. Best, Mike On Thu, Mar 25, 2021 at 20:42 jian Xu <jia...@gm...> wrote: > Hi, > In QuantLib, given a semi-annual FixedRateBond with 1% coupon, and > Actual/Actual day count convention, the actual coupon payment amount > varies. > > But my understanding is that the DCC only affects the accrual > calculation, not the actual coupon payment amount. Is this correct? > A check on the Bloomberg terminal seems to confirm this, since any > Act/Act bond also shows the coupon amount to be constant. > > So why is QuantLib different from Bloomberg? Which one is correct in > reality? (US bond market). Thank you very much. > > Following is a piece of code to produce the varying coupon in Python: > > import numpy as np > import pandas as pd > import QuantLib as ql > > acc_start = ql.Date(15, 2, 2020) > maturity = ql.Date(15, 2, 2025) > end_of_month = False > calendar = ql.UnitedStates(ql.UnitedStates.GovernmentBond) > period = ql.Period(ql.Semiannual) > accrual_convention = ql.Unadjusted > date_gen_rule = ql.DateGeneration.Backward > > schedule = ql.MakeSchedule(effectiveDate=acc_start, > terminationDate=maturity, > tenor=period, > calendar=calendar, > convention=accrual_convention, > rule=date_gen_rule, > endOfMonth=end_of_month) > > face = 100 > redemption = 100 > issue_date = ql.Date(16, 2, 2020) > day_count = ql.ActualActual() > coupon = 0.01 > days_settle = 2 > payment_convention = ql.ModifiedFollowing > > bond = ql.FixedRateBond(days_settle, face, schedule, [coupon], > day_count, payment_convention, redemption, issue_date) > > Then [(cf.date(), cf.amount()) for cf in bond.cashflows()] shows the > amount is not constant. > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |