|
From: Luigi B. <lui...@gm...> - 2020-11-27 08:34:14
|
Hello,
you can retrieve them from spotCurve (methods dates(), zeroRates() or
nodes()) but not from spotCurveHandle, which only has the interface of the
base YieldTermStructure class.
Luigi
On Thu, Nov 26, 2020 at 11:38 PM Brian Smith <bri...@gm...>
wrote:
> Hi,
>
> Let say I build a term structure like this -
>
> from QuantLib import *
> import math
>
> todaysDate = Date(1, 9, 2019)
> Settings.instance().evaluationDate = todaysDate
> dayCount = Actual365Fixed()
> calendar = Canada()
> interpolation = Linear()
> compounding = Compounded
> compoundingFrequency = Continuous
>
> spotDates = [todaysDate, todaysDate + Period("6m"), todaysDate +
> Period("1y"), todaysDate + Period("2y"), todaysDate + Period("3y")]
> spotRates = [0, 0.061682, 0.066682, 0.067199, 0.067502]
>
> spotCurve = ZeroCurve(spotDates, spotRates, dayCount, calendar,
> interpolation, compoundingFrequency)
> spotCurveHandle = YieldTermStructureHandle(spotCurve)
>
> Now, from the spotCurveHandle object, I want to extract all Nodes
> dates and rate information. Ofcourse I can get such information from
> spotDates and spotRates respectively, however I am looking for some
> way to extract the same information from the spotCurveHandle itself.
>
> Is there any method to do the same?
>
> Thanks for your insights.
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|