Code Monkey home page Code Monkey logo

Comments (7)

Kmanolo avatar Kmanolo commented on May 29, 2024 1

I am not making a choice on the termination biz day convention and coupon biz day convention; these are read from bond's reference data, provided by Markit and are supposed to be as per my first post, though could very well be wrong as Markit often
changes these data on bonds.

However, I am using 1.29 and it seems that the problem goes away on 1.31 so thank you for the pointer and help!

from quantlib.

boring-cyborg avatar boring-cyborg commented on May 29, 2024

Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.

from quantlib.

HristoRaykov avatar HristoRaykov commented on May 29, 2024

When is the first coupon date? Is it regular, short or long? Your termination convention is Following in the code above. If you want regular first coupon then set endOfMonth to false and DateGeneration::Forward. If first coupon is not regular set firstDate to first coupon date and again DateGeneration::Forward. If you want to set the last coupon date instead of first then use nextToLastDate and DateGeneration::Backward.

    Date firstCouponDate = Date(...);
    Schedule bond_sched(issue_date, maturity_date,
                        Period(Semiannual), bond_calendar,
                        bond_convention,
                        Unadjusted,
                        DateGeneration::Forward,
                        true,
                        firstCouponDate);

from quantlib.

Kmanolo avatar Kmanolo commented on May 29, 2024

The date generation rule is backward for this bond and the termination convention is specified as Following in its reference data.
The end of month, date generation and biz day convention, if changed, would alter the coupon schedule for the bond, to pay coupons on the start of the following month so I think that won't work.

It is very confusing why using a termination convention other than unadjusted, moves the first date of the schedule to end of month, which is what messes up the accrual for the bond.

Thanks vm for your help and suggestions.

from quantlib.

HristoRaykov avatar HristoRaykov commented on May 29, 2024

I can not see the problem. Running your code with empty call schedule as callability_prices are not given received accrued amount of 4.175 as expected by BBG. Only termination date is moved to the next month you can use ModifiedFollowing to avoid this which in fact doesn't affect accrued amount.

from quantlib.

HristoRaykov avatar HristoRaykov commented on May 29, 2024

Which version of QuantLib are you using? If below 1.31 please update to at least 1.31 and try again as there has been change of behavior to the end of month for effective date and the termination date.

from quantlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.