|
From: Brian S. <bri...@gm...> - 2021-04-03 09:10:21
|
Hi,
I want to extract all the cash flow amounts from a bond as defined below -
from QuantLib import *
mydate = Date(31, 1, 2018)
spots = [mydate, mydate + Period("6m"), mydate + Period("1y"), mydate
+ Period("2y"), mydate + Period("3y")]
spotsdate = [0, 0.25, 0.45, 0.65, 0.85]
curveHandle = YieldTermStructureHandle(ZeroCurve(spots, spotsdate,
Actual360(), Canada(), Linear(), Continuous))
[c.amount() for c in FloatingRateBond(0, 10000, Schedule(mydate,
mydate + Period("1y"), Period(6, Months), Canada(), Unadjusted,
Unadjusted, DateGeneration.Forward, False) , Euribor6M(curveHandle),
Actual360()).cashflows()]
However above code failed to achieve any result, but giving out below error -
Traceback (most recent call last):File "<stdin>", line 1, in
<module>File "<stdin>", line 1, in <listcomp>File
"/usr/local/lib/python3.9/site-packages/QuantLib/QuantLib.py", line
9967, in amountreturn _QuantLib.CashFlow_amount(self)RuntimeError:
Missing Euribor6M Actual/360 fixing for January 29th, 2018
I wonder where the date January 29th, 2018 comes from and how to resolve this?
Any pointer will be highly appreciated.
Thanks for your time.
|