0
$\begingroup$

I am not being able to set the pillar date of an overnight interest swap helper to its maturity date.

I have the following code:

valuation_date = ql.Date(24, 8, 2023)
calendar = ql.UnitedStates(ql.UnitedStates.FederalReserve)
spot_date = calendar.advance(valuation_date, 2, ql.Days)

sofr = ql.OvernightIndex('SOFRRATE', 2, ql.USDCurrency(), calendar, ql.Actual360())

period = ql.Period('2W')
qlQuote = ql.QuoteHandle(ql.SimpleQuote(5.3050))

helper = ql.OISRateHelper(2, period, qlQuote, sofr, paymentFrequency=ql.Once, pillar=ql.Pillar.MaturityDate)

print(valuation_date)
print(spot_date)
print(helper.pillarDate())
print(helper.maturityDate())

The print functions return the following values:

August 24th, 2023
August 28th, 2023
September 13th, 2023
September 13th, 2023

As my manual calculation, the maturity/pillar date should be September 11th, 2023. The following code illustrate it:

valuation_date = ql.Date(24, 8, 2023)
calendar = ql.UnitedStates(ql.UnitedStates.FederalReserve)
spot_date = calendar.advance(valuation_date, 2, ql.Days)

period = ql.Period('2W')
maturity_date = calendar.advance(spot_date, period)

print(maturity_date)

It results in:

September 11th, 2023

As expected.

How can I set the correct pillar date in the helper construction? What am I missing?

$\endgroup$

1 Answer 1

0
$\begingroup$

I just realize that the valuation_date was not being referenced anywhere into the curve bootstrap process.

The problem was solved referencing the valuation date to the evaluationDate setting:

ql.Settings.instance().evaluationDate = today
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.