#127 Bond Yield calculation for short maturity bonds

None
closed
nobody
None
5
2017-01-30
2010-11-23
Anonymous
No

Source file: bond.cpp

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-11-23

    Rate Bond::yield(const DayCounter& dc,
    Compounding comp,
    Frequency freq,
    Real accuracy,
    Size maxEvaluations) const {
    Real currentNotional = notional(settlementDate());
    if (currentNotional == 0.0)
    return 0.0;

    return BondFunctions::yield(*this, cleanPrice(), dc, comp, freq,
    settlementDate(),
    accuracy, maxEvaluations);
    }

    In the above function:
    Real currentNotional = notional(settlementDate());
    should be
    Real currentNotional = notional(settlementDate(settlement));
    else it will always return yield=0 if settlement < maturity date. this is observed for short maturity bonds.

     
  • Luigi Ballabio

    Luigi Ballabio - 2011-07-19

    You mean that the settlement should be an additional argument? That would not be feasible, since the clean price should be calculated at the same date. Also, I'm not sure that you really meant with "when settlement < maturity date", since the settlement cannot be later than the maturity. Do you have some code that reproduces the problem?

     
  • Luigi Ballabio

    Luigi Ballabio - 2011-07-19
    • status: open --> pending
     
  • Luigi Ballabio

    Luigi Ballabio - 2017-01-30
    • status: pending --> closed
    • Group: -->
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks