|
From: David D. <nh...@gm...> - 2019-12-27 10:41:56
|
Goutham,
Why are you using the Euribor6M Index for an instrument in INR?
There are some indexes with predefined conventions but you can define your
own. Here is an example to try to make this clear.
I am checking the properties of some predefined indexes and in the last
case I am creating my own (I don't know the conventions for indian rupee
indexes).
import QuantLib as ql
import pandas as pd
index_data = []
indexes = [
ql.Euribor6M(),
ql.Euribor3M(),
ql.USDLibor(ql.Period('6M')),
ql.USDLiborON(),
ql.Libor('MyIndex', ql.Period('6M'), 2, ql.INRCurrency(), ql.India(),
ql.Actual360())
]
properties = ['familyName', 'currency', 'dayCounter', 'tenor',
'endOfMonth', 'fixingCalendar', 'fixingDays']
for index in indexes:
index_data.append({prop: eval(f"index.{prop}()") for prop in
properties})
pd.DataFrame(index_data)
In your particular case, if you are using Euribor6M as the index which has
the TARGET fixing calendar, you can check for the holidays in December with
this snippet:
calendar = ql.TARGET()
calendar.holidayList(ql.TARGET(), ql.Date(1,12,2019), ql.Date(31,12,2019))
which would show >>>> (Date(25,12,2019), Date(26,12,2019))
So if you have a swap starting 27.12.2019 with this calendar, it would
expect a fixing on the 23.12.2019 for an index with 2 settlementdays .
On Fri, 27 Dec 2019 at 05:40, Goutham Mahesh <gou...@gm...>
wrote:
> Dear David,
>
> So the thing is 23rd is not a holiday here in India and I am still
> receiving the error. When i use the United States calendar, the same error
> is coming except for one difference: Euribor 3M fixing is not there for *24th
> December. *Don't know why this error is coming, as both of these dates in
> India and the US the markets were open. Would be good to hear back from
> you, if you want some more information i can attach parts of the code.
>
> Thank You,
> Best,
> Goutham
>
> On Thu, Dec 26, 2019 at 8:28 PM David Duarte <nh...@gm...> wrote:
>
>> Hi,
>>
>> Seem like QuantLib is expecting one of your instruments (looks like 2y
>> swap) to have a Euribor6M fixing on the 23rd of December.
>> You should check your calendars because if start date is 27.12 and you
>> have holidays on the 24th and 25th of Dec, then the fixing would be 23.
>>
>> If you manually add the fixing, the error would probably go away
>>
>> index.addFixing(ql.Date(23, 12, 2019), -0.00339)
>>
>> but I don't think that is what you want because since you are
>> bootstrapping INR and USD you should use another index with the
>> appropriate calendars.
>>
>> Hope that helps
>>
>> On Thu, 26 Dec 2019 at 12:23, Goutham Mahesh <gou...@gm...>
>> wrote:
>>
>>> Hi,
>>>
>>> So I am calculating discount factors for INR and USD using
>>> bootstrapping. My code has been working fine so far and is giving me
>>> discount actors for all previous dates. But specifically for the date of
>>> 24th December 2019, I am receiving the following error:
>>>
>>> Traceback (most recent call last):
>>> File "discount_factor_hardcode_test.py", line 101, in <module>
>>> print("",depoFuturesSwapCurve.dates())
>>> File
>>> "/usr/local/lib/python3.5/dist-packages/QuantLib_Python-1.15-py3.5-linux-x86_64.egg/QuantLib/QuantLib.py",
>>> line 20084, in dates
>>> return _QuantLib.PiecewiseFlatForward_dates(self)
>>> RuntimeError: 1st iteration: failed at 3rd alive instrument, pillar
>>> December 27th, 2021, maturity December 27th, 2021, reference date December
>>> 27th, 2019: 2nd leg: Missing Euribor6M Actual/360 fixing for December 23rd,
>>> 2019
>>>
>>> Can someone help me with this as I am lost and have no clue how to fix
>>> it.
>>>
>>> Thank You,
>>> Best,
>>> Goutham
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
|