|
From: Pedro C. <coe...@gm...> - 2019-12-27 14:11:31
|
Hi Sumit, Just write as the below: # enableExtrapolation returns nothing, so you just have to call it alone self.z_discurve_1.QLZeroCurve.enableExtrapolation() # Than pass the curve to a Handle, in this case the YieldTermStructureHandle zc_extrapolated = YieldTermStructureHandle(self.z_discurve_1) engine = ql.DiscountingSwapEngine(zc_extrapolated) Regards, Pedro Coelho Em sex., 27 de dez. de 2019 às 10:54, Sumit Sengupta < su...@mo...> escreveu: > Hi, > > I have a 50y swap which I am trying to price using a ZeroCurve that I've fitted. However, the maturity of my zero curve is for *30Y.* > > Hence I modify the below statement.... > > engine = ql.DiscountingSwapEngine(self.z_discurve_1.QLZeroCurve) > self.QL_Swap1.setPricingEngine(engine) > > to > > zc_extrapolated = self.z_discurve_1.QLZeroCurve.enableExtrapolation() > > engine = ql.DiscountingSwapEngine(*zc_extrapolated*) > self.QL_Swap1.setPricingEngine(engine) > > However, the ql.DiscountingSwapEngine(...) line gives me an error:- > > def __init__(self, *args): > > this = _QuantLib.new_DiscountingSwapEngine(*args) > E ValueError: invalid null reference in method 'new_DiscountingSwapEngine', argument 1 of type 'Handle< YieldTermStructure > const &' > > Any help on how to correctly extrapolate my ZeroCurve would be appreciated. > > > Thanks, > > Sumit > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |