SwapRateHelper 无法以 4W 频率交换:"undecidable comparison between 4W and 1M"
SwapRateHelper fails for swap with 4W frequency: "undecidable comparison between 4W and 1M"
我在 Python 中使用 QuantLib 1.7。
我正在尝试为 MXN TIIE 掉期建立掉期曲线,它是一种香草固定浮动,两条腿的频率均为 4 周。
当我调用 SwapRateHelper 时收到错误消息 "undecidable comparison between 4W and 1M"。但是我的代码中没有任何地方提到 1M tenor...我不明白这是什么问题。
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('12W')
frequency = ql.EveryFourthWeek
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)
1.7.1版本修复的bug;参见 https://github.com/lballabio/QuantLib/issues/28。
我在 Python 中使用 QuantLib 1.7。
我正在尝试为 MXN TIIE 掉期建立掉期曲线,它是一种香草固定浮动,两条腿的频率均为 4 周。
当我调用 SwapRateHelper 时收到错误消息 "undecidable comparison between 4W and 1M"。但是我的代码中没有任何地方提到 1M tenor...我不明白这是什么问题。
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('12W')
frequency = ql.EveryFourthWeek
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)
1.7.1版本修复的bug;参见 https://github.com/lballabio/QuantLib/issues/28。