How do I use FixedRateBondPriceByYield() function on maturity date that is earlier than today? I get "non tradable error" when applying on date older than today.

FixedRateBondPriceByYield(, settlementDays=1, yield = 0.01524, 
                          maturityDate = as.Date('2015-07-31'),
                          issueDate = as.Date('2010-07-31'),
                          effectiveDate = as.Date('2010-08-10'),
                          period = 3,
                          rates = 0.0175)

Error in fixedRateBondPriceByYieldEngine(settlementDays, yield, calendar,  : 
  non tradable at September 28th, 2015 (maturity being July 31st, 2015)

Note: Changing the maturityDate to a date later than today returns an answer.

  • $\begingroup$ I figured that this works to return an answer maturityDate = advance('UnitedStates/GovernmentBond', as.Date('2015-07-31'), 10, 3) $\endgroup$ – shawnl Sep 28 '15 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.