0
$\begingroup$

There is a mismatch in the Quantlib documentation instructions and Quantlib GitHub, on pricing simple bonds and term structure building, ql.Schedule

I believe IssueDate should go in ql.schedule not a settlement date as shown in the Quantlib documentation? hence, the documentation seems to be wrong, to me?

QuantLib-SWIG/Python/examples/bonds.py

bondsHelpers = []

for issueDate, maturity, couponRate, marketQuote in bondQuotes:
    *****schedule = ql.Schedule(
        issueDate,*****
        maturity,
        ql.Period(ql.Semiannual),
        ql.UnitedStates(ql.UnitedStates.GovernmentBond),
        ql.Unadjusted,
        ql.Unadjusted,
        ql.DateGeneration.Backward,
        False,
    )
    bondsHelpers.append(
        ql.FixedRateBondHelper(
            ql.QuoteHandle(ql.SimpleQuote(marketQuote)),
            settlementDays,
            100.0,
            schedule,
            [couponRate],
            ql.ActualActual(ql.ActualActual.Bond),
            ql.Unadjusted,
            redemption,
            issueDate,
        )
    )

QuantLib-Python Documentation

instruments = []
for idx, row in pgbs.iterrows():
    maturity = ql.Date(row.maturity, '%d-%m-%Y')
    ***schedule = ql.Schedule(
        bondSettlementDate,***
        maturity,
        ql.Period(frequency),
        calendar,
        accrualConvention,
        accrualConvention,
        ql.DateGeneration.Backward,
        False)
    helper = ql.FixedRateBondHelper(
            ql.QuoteHandle(ql.SimpleQuote(row.px)),
            bondSettlementDays,
            100.0,
            schedule,
            [row.coupon / 100],
            dc,
            convention,
            redemption)

    instruments.append(helper)
$\endgroup$
1
  • $\begingroup$ I would also use the issue date. If you have a GitHub account, you can probably click on the "Edit on GitHub" link at the top right of the page and suggest a change. $\endgroup$ Jan 22 at 19:19

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.