固定收益
RQuantLib FixedRateBondPriceByYield() 不可交易錯誤
如何使用
FixedRateBondPriceByYield()
早於今天的到期日功能?在比今天早的日期申請時,我收到“不可交易錯誤”。library('RQuantLib') FixedRateBondPriceByYield(, settlementDays=1, yield = 0.01524, faceAmount=100, 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)
注意:將maturityDate 更改為晚於今天的日期會返回答案。