Tuesday, April 23, 2019

python - TOIS (CHF), TONAR (JPY), AONIA(AUD) in Quantlib


I am looking for the TOIS, TONAR, AONIA in Quantlib for discounting. I only could find the EOINA, FEDFUNDS, SONIA etc.Do I miss something? In case they don't exist how can I use the corresponding rate helpers in quantlib (python).



Answer



Not all overnight indexes were given a specific class.


As a workaround, you can create an instance of the OvernightIndex class and pass it the relevant parameters (fixing calendar, day counter etc.). E.g., if there wasn't an EONIA class already, you could build an instance of it as:



index = OvernightIndex("EONIA", 0, EURCurrency(),
TARGET(), Actual360(), curve_handle)

where the parameters are a name for the index, the number of settlement days, the currency, the fixing calendar, the day counter, and a handle to the curve used to forecast the fixings.


If you find yourself doing this often, and if you can write some C++, you might also consider writing a specific class (like EONIA and the like) and possibly contribute it to QuantLib. You can compare the code above with the contents of ql/indexes/ibor/eonia.hpp and ql/indexes/ibor/eonia.cpp to see how that can be done.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...