Investigating QuantLib and Bloomberg Clean-Price Differences for a Fixed-Rate Bond
Summary
This question presents a reproducible QuantLib setup for pricing a fixed-rate bond and asks why its calculated clean price differs substantially from a Bloomberg price. It specifies the evaluation date, US Government Bond calendar, settlement lag, semiannual schedule, coupon rate, day-count convention, yield, compounding frequency, and the call to calculate the clean price. The displayed result is lower than the Bloomberg figure, but the document does not include an answer or identify the cause.
The example is useful as a case study in bond-pricing implementation because it makes several convention choices explicit. A price comparison needs consistent settlement and accrued-interest treatment, schedule generation and date adjustments, day-count conventions, yield compounding, and the pricing date. However, the provided information does not establish which input differs from Bloomberg’s bond description or yield analysis settings. It therefore raises a diagnostic problem rather than providing a confirmed reconciliation or a general pricing method.
Key ideas
- The example compares a QuantLib clean price with a Bloomberg clean price for a fixed-rate bond.
- Bond price calculations depend on conventions for schedules, settlement, day count, and yield compounding.
- A reproducible parameter set helps frame a pricing discrepancy for investigation.
- The document gives no answer, so it does not establish which convention causes the reported gap.
Tags
Full text
# Quantlib match clean price with bbg clean price : Huge gap between calculated price and bloomberg
# Quantlib match clean price with bbg clean price : Huge gap between calculated price and bloomberg
I am not able to make quantlib match bloomber price, maybe I don't use the right parameters into `ql.Schedule` or `ql.FixedRateBond`
I have a price of : 90.012 instead of 93.508 [Huge spread between my result and bloomberg]
Below is the reproducible example :
```
import QuantLib as ql
todaysDate= ql.Date(2,6,2023)
ql.Settings.instance().setEvaluationDate(todaysDate)
# Market conventions
calendar = ql.UnitedStates(ql.UnitedStates.GovernmentBond)
settlementDays = 2
faceValue = 100
compounding = ql.Compounded
compoundingFrequency = ql.Semiannual
# Bond schedule setup
issueDate = ql.Date(15, 5, 2019)
maturityDate = ql.Date(15, 5, 2029)
tenor = ql.Period(ql.Semiannual)
schedule = ql.Schedule(issueDate, maturityDate, tenor, calendar,
ql.Unadjusted, ql.Unadjusted, ql.DateGeneration.Backward, False)
# Bond parameters
rate = 3.5/100
dayCount = ql.Thirty360(ql.Thirty360.BondBasis)
bond = ql.FixedRateBond(settlementDays, faceValue, schedule, [rate], dayCount)
# YTM calculation
yieldRate = 4.767131/100 # YTM
yieldDayCount = ql.Thirty360(ql.Thirty360.BondBasis)
yieldCompoundingFrequency = ql.Semiannual
cleanPrice = bond.cleanPrice(yieldRate, yieldDayCount, compounding,
yieldCompoundingFrequency, issueDate)
print("The clean price of the bond is: ", cleanPrice)
```
Bond DES and YASQ
Can someone help me to understand what I am doing wrong ?
Side Note :
I have seen this answer but it seems that my issue is something else.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.