|
From: Brian S. <bri...@gm...> - 2020-11-26 22:33:31
|
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.
|