QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

Failed to create a SwapRateHelper with frequency ql.Once

Open JackPai100 opened this issue 1 year ago • 1 comments

I'd like to create a SwapRateHelper for a swap that pays fixed leg interest at maturity. I tried ql.Once, but it gives me "unknown fixed leg default tenor" error. Some swap pays interest at maturity for tenor less than 1Y. Here is the sample code to reproduce the issue. Note, I am using MXN as a made-up example, even though MXN has a 4W frequency in realty.

import QuantLib as ql

tiie_index = ql.IborIndex('TIIE', ql.Period('4W') , 1, ql.MXNCurrency(), ql.NullCalendar(), ql.Following, False, ql.Actual360())

rate = 0.02

tenor = ql.Period('4W')

frequency = ql.Once # This will cause failure. What should I set for at-maturity type swap?

bdays_adj = ql.Following

day_count = ql.Actual360()

h = ql.SwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate)), tenor, ql.Mexico(), frequency, bdays_adj, day_count, tiie_index)

JackPai100 avatar Aug 19 '24 14:08 JackPai100

Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.

boring-cyborg[bot] avatar Aug 19 '24 14:08 boring-cyborg[bot]