How can I calc with QuantLib the coupon amount of a floating rate IborCoupon on the 3M Euribor Index with a given 3M Euribor Index Fixing?
If I try the following Python code:
from QuantLib import * index = Euribor(Period(3, Months)) start = DateParser_parseISO("2019-02-22") end = DateParser_parseISO("2019-05-22") coupon = IborCoupon(end, 1.0, start, end, 2, index) fixDate = coupon.fixingDate() index.addFixing(fixDate, 0.04) print coupon.amount()
I get the error
pricer not set.
I was wondering about the error cause from my understanding no pricer is needed, cause the the relevant Fixing is allready given. The result should be roughly 0.01.
Looking into the (c++) source code of the
amount() method or more precisly the
rate() method, I can see that on every call the existence of a pricer is checked.
Therefore I suppose my code is the wrong way to do this.