|
From: SourceForge.net <no...@so...> - 2010-11-23 14:03:04
|
Bugs item #3116601, was opened at 2010-11-23 14:01 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3116601&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Bond Yield calculation for short maturity bonds Initial Comment: Source file: bond.cpp ---------------------------------------------------------------------- >Comment By: https://www.google.com/accounts () Date: 2010-11-23 14:03 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3116601&group_id=12740 |