QuantLib
QuantLib copied to clipboard
Failed to create a SwapRateHelper with frequency ql.Once
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)
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.