|
From: Sumit S. <su...@mo...> - 2019-12-27 14:21:28
|
Thanks Pedro. However, the above line gives me this error:- def __init__(self, *args): > this = _QuantLib.new_YieldTermStructureHandle(*args) E NotImplementedError: Wrong number or type of arguments for overloaded function 'new_YieldTermStructureHandle'. E Possible C/C++ prototypes are: E Handle< YieldTermStructure >::Handle(boost::shared_ptr< YieldTermStructure > const &) E Handle< YieldTermStructure >::Handle() ..\..\..\Anaconda3\envs\pricer-end\lib\site-packages\QuantLib\QuantLib.py:5719: NotImplementedError On Fri, 27 Dec 2019 at 14:13, Pedro Coelho <coe...@gm...> wrote: > Just a typo, I forgot the QLZeroCurve in the statement below: > > zc_extrapolated = YieldTermStructureHandle(self.z_discurve_1.QLZeroCurve) > > > Em sex., 27 de dez. de 2019 às 11:11, Pedro Coelho <coe...@gm...> > escreveu: > >> 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 >>> >> -- Mosaic Smart Data mobile +44 (0)7961839363 su...@mo... 25 Finsbury Circus ▫ EC2M 7EE ▫ London ▫ United Kingdom www.mosaicsmartdata.com |