much appreciated if anyone can help with the below, basically i'm trying to construct a yield curve using some real market data. I have pasted the python code below. I use a list of swap rates and getting some root not bracketed errors, after removing some swap rates, I'm left with 9y and 10y AUD swap rates. As long as these two are included, then the curve construction won't work. believe these are real market data as of 2021-01-04. the error I'm getting:
RuntimeError: 1st iteration: failed at 2nd alive instrument, pillar January 6th, 2031, maturity January 6th, 2031, reference date January 4th, 2021: root not bracketed: f[0.0830554,0.627492] -> [-3.376389e+01,-1.733717e+01]
import QuantLib as ql
swapHelpers = []
pricingDate = ql.DateParser.parseFormatted('2021-01-04', '%Y-%m-%d')
effectiveDate = ql.DateParser.parseFormatted('2021-01-06', '%Y-%m-%d')
dayCount = ql.Actual360()
terminationDate1 = ql.DateParser.parseFormatted('2031-01-06', '%Y-%m-%d')
schedule1 = ql.Schedule(effectiveDate,
terminationDate1,
ql.Period(ql.Quarterly),
ql.Australia(),
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Backward,
False)
helper1 = ql.FixedRateBondHelper(ql.QuoteHandle(ql.SimpleQuote(100)),
2,
100,
schedule1,
[0.1838],
dayCount,
ql.ModifiedFollowing,
)
swapHelpers.append(helper1)
terminationDate2 = ql.DateParser.parseFormatted('2030-01-06', '%Y-%m-%d')
schedule2 = ql.Schedule(effectiveDate,
terminationDate2,
ql.Period(ql.Quarterly),
ql.Australia(),
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Backward,
False)
helper2 = ql.FixedRateBondHelper(ql.QuoteHandle(ql.SimpleQuote(100)),
2,
100,
schedule2,
[0.165],
dayCount,
ql.ModifiedFollowing,
)
swapHelpers.append(helper2)
yieldcurve = ql.PiecewiseLogCubicDiscount(pricingDate,
swapHelpers,
ql.Actual360())
yieldcurve.enableExtrapolation()
yieldcurve.dates()