I'm using Python 2.7.12 with the QuantLib package. I'm trying to price fixed bonds. I understand how to create a bond object. How to get the "right" discounting curve is kind of a problem. Assuming a non-flat term structure, I have seen the ql.ZeroCurve function:
spotCurve = ql.ZeroCurve(spotDates, spotRates, dayCount, calendar, interpolation, compounding, compoundingFrequency) spotCurveHandle = ql.YieldTermStructureHandle(spotCurve) bondEngine = ql.DiscountingBondEngine(spotCurveHandle) fixedRateBond.setPricingEngine(bondEngine)
I assume the inputs are the maturities and yields of zeros with the same "risk" as the bond, we are looking at.
How can I specify the discount curve directly, e.g. when having the discount factors published by authorities like the FED or the ECB?
Thanks in advance