1
$\begingroup$

I'm trying to match QL clean price with BBG clean price for POLGB 2.75 10/25/29 1029 priced for 15th of October 2021 for 2.5% yield. I'm not sure if my setup of bond is wrong or if there is a problem with precision of calculations.

import QuantLib as ql

todaysDate= ql.Date(15,10,2021)

ql.Settings.instance().setEvaluationDate(todaysDate)

issueDate = ql.Date(11, 2, 2019)
maturityDate = ql.Date(25, 10, 2029)
tenor = ql.Period(ql.Annual)
calendar = ql.Poland()
bussinessConvention = ql.Following
dateGeneration = ql.DateGeneration.Backward
monthEnd = False
schedule = ql.Schedule (ql.Date(25,10,2018), maturityDate, tenor, calendar, ql.Unadjusted,
                            ql.Unadjusted , dateGeneration, monthEnd)

dayCount = ql.ActualActual(ql.ActualActual.ISMA)
couponRate = .0275
coupons = [couponRate]

settlementDays = 0
faceValue = 100
fixedRateBond = ql.FixedRateBond(settlementDays, faceValue, schedule, coupons, dayCount)

print(round(fixedRateBond.cleanPrice(0.025,ql.ActualActual(ql.ActualActual.ISMA),ql.CompoundedThenSimple,ql.Annual),6))

QuantLib clean price = 101.796832
BBG clean price = 101.796834

$\endgroup$
2
  • 1
    $\begingroup$ Are you using the same settlement date? Can you post Bloomberg DES and YA for comparison please? $\endgroup$ Oct 20, 2021 at 15:23
  • $\begingroup$ Yes, both settlement dates were the same for bbg and ql e.i 15th October 2021. \ POLGB 2 ¾ 10/25/29 ( PL0000111498 ) Spread 18.52bp vs   8yPOLGB 2 ¾ 10/29 Price 101.796834  103.154  Yield 2.5000000Wst   2.3147811  Ann Wkout 10/25/2029@ 100.00   Yld7 7 Settle 10/15/21 10/15/21 Trade 10/13/21 Retro (Using input price) $\endgroup$ Oct 20, 2021 at 15:36

1 Answer 1

4
$\begingroup$

BBG does not adjust dates when calculating NPV. To get the same result in QuantLib we need to add ql.Unadjusted to FixedRateBond parameter. Also to get exactly the same clean price we need to calculate dirty price and subtract rounded accrued amount.

fixedRateBond = ql.FixedRateBond(settlementDays, faceValue, schedule, coupons, dayCount, ql.Unadjusted)

print(round(fixedRateBond.dirtyPrice(0.025,ql.ActualActual(ql.ActualActual.ISMA),
ql.Compounded,ql.Annual),6)-round(fixedRateBond.accruedAmount(ql.Date(15,10,2021)),3))

Quantlib clean price = 101.796834

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.