I'm wondering how to precisely handle the quote convention of ON, TN, and S/N of FX quote. How to handle these convention in quantlib.
Here is my code, is that correct?
settlementDays = 2 #OIS convention
discount_term_structure = ql.RelinkableYieldTermStructureHandle()
oindex_on = ql.OvernightIndex('',0,ql.USDCurrency(),calendar,ois_dayCount,discount_term_structure)
oindex_tn = ql.OvernightIndex('',1,ql.USDCurrency(),calendar,ois_dayCount,discount_term_structure)
oindex_sn = ql.OvernightIndex('',2,ql.USDCurrency(),calendar,ois_dayCount,discount_term_structure)
oindex = ql.OvernightIndex('',settlementDays,ql.USDCurrency(),calendar,ois_dayCount,discount_term_structure)
oisHelpers = []
oisHelpers.append(ql.OISRateHelper(0,ql.Period(ois_data.loc[0,'Tenor']), ql.QuoteHandle(ois_data.loc[0,'Rate_handler']),oindex_on))
oisHelpers.append(ql.OISRateHelper(1,ql.Period(ois_data.loc[1,'Tenor']), ql.QuoteHandle(ois_data.loc[1,'Rate_handler']),oindex_tn))
oisHelpers.append(ql.OISRateHelper(2,ql.Period(ois_data.loc[2,'Tenor']), ql.QuoteHandle(ois_data.loc[2,'Rate_handler']),oindex_sn))
oisHelpers = oisHelpers + [ql.OISRateHelper(settlementDays,ql.Period(ois_data.loc[i,'Tenor']), ql.QuoteHandle(ois_data.loc[i,'Rate_handler'])\
,oindex) for i in range(3,len(ois_data))]```
Tenor Rate Rate_handler
0 1D 0.0160 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
1 1D 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
2 1D 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
3 1W 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
4 2W 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
5 3W 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
6 1M 0.0159 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
7 2M 0.0158 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
8 3M 0.0157 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
9 6M 0.0151 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
10 9M 0.0145 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
11 1Y 0.0138 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
12 2Y 0.0122 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
13 3Y 0.0112 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
14 4Y 0.0114 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
15 5Y 0.0115 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
16 6Y 0.0116 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
17 7Y 0.0118 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
18 8Y 0.0121 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
19 9Y 0.0124 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
20 10Y 0.0127 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
21 12Y 0.0131 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
22 15Y 0.0137 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
23 20Y 0.0143 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
24 25Y 0.0145 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...
25 30Y 0.0146 <QuantLib.QuantLib.SimpleQuote; proxy of <Swig...