strange bond behavior??
Posted by laotze00 on
URL: http://quantlib.414.s1.nabble.com/strange-bond-behavior-tp4348.html
Hi, I noticed some strange behavior with the bond FixedCouponBond
class. When outputing the cashflows, the first coupon is wrong. Here
is my simple python code that demonstrate the problem. Thanks a lot
for your attention!
from QuantLib import *
calendar = UnitedStates()
settlementDays = 1
issue = Date(15,11,2005)
d1 = Date(1,12,2005)
mat = Date(15,11, 2010)
coupon = [1, 0.1]
bond = FixedCouponBond(issue, d1, mat, settlementDays, coupon, Annual,
Thirty360(), calendar)
flows = bond.cashflows()
for item in flows:
print item.date(), item.amount()
output:
November 15th, 2006 95.5555555556
November 15th, 2007 10.0
November 17th, 2008 10.0555555556
November 16th, 2009 9.97222222222
November 15th, 2010 9.97222222222