I'm trying to price a fixed rate bond in Quantlib but the result comes out wrong.

I'm trying to price 1Y fixed rate bond:

issue_date= 06-03-2008
maturity_date = 06-03-2009
day_count = ACT/ACT

I expect 100, however QL returns 99.99989509825711.

Both Bloomberg and Excel return 100, as does my manual calculation. Thanks!


1 Answer 1


This is how I would price the bond in Python with your inputs. You can translate it easily to C++ if that's what you're using.

from QuantLib import *

Settings.instance().evaluationDate = Date(6,3,2008)

schedule = Schedule(Date(6,3,2008), Date(6,3,2009), Period(6,Months),
                    NullCalendar(), Following, Following,
                    DateGeneration.Forward, False)

bond = FixedRateBond(0, 100.0, schedule, [0.02], ActualActual(ActualActual.ISMA))

print(bond.cleanPrice(0.02, ActualActual(ActualActual.ISMA), Simple, Semiannual))

and the result is 100 as expected (by the way, I'm not sure whether you should use Simple or Compounded as compounding, but it doesn't seem to make a difference in this case). I'm using the latest QuantLib version, 1.15.

Are you using the same code? If not, what is different?

  • 1
    $\begingroup$ Thank you that's super helpful, we were not using NullCalendar which seems to be causing the issue! $\endgroup$ Commented Feb 28, 2019 at 12:03

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.