|
From: Javid A. <jav...@ya...> - 2020-09-01 14:05:08
|
Hi All, I am trying to reproduce the Eonia discount curve example provided in the QuantLib Python Cookbook (Chapter 8, page 61) using both QuantLib Python in a Jupyter notebook as well as QuantLib Excel. As part of a basic 'sanity' check I want to be able to demonstrate that the PVs of the instruments used to build this curve are zero. When I use QL Excel (Version 16) I get a number of errors which I need help to resolve. If necessary I can provide my spreadsheet if that would be helpful. The specific problems I am encountering are: (1) The function qlPiecewiseYieldCurve only seems to work with interpolation types of LogLinear, Linear, BackwardFlat or ForwardFlat. If I use either CubicSpline or LogCubic interpolation this function seems to fail with error messages below: "qlPiecewiseYieldCurve - Unknown id for Type: Discount:LogCubic" or "qlPiecewiseYieldCurve - Unknown id for Type: Discount:CubicSpline" According to the link below both are acceptable interpolation types for this function.https://www.quantlib.org/quantlibaddin/func_piecewiseyieldcurve.html#qlPiecewiseYieldCurve Is this a known bug or am I doing something wrong? (2) In order to construct the EONIA discount curve I have used a combination of qlDepositRateHelper, qlOISRateHelper and qlDatedOISRateHelper. I then used the function qlOvernightIndexedSwapfromOISRateHelper which I understood would create an OIS Swap object from the OIS helpers used. Although this function seems to work for an OIS helper created using the qlOISRateHelper function, it seems to fail when applied to an OIS helper created using the qlDatedOISRateHelper with error message: qlOvernightIndexedSwapFromOISRateHelper - Error retrieving object with id 'EUROISFRA1#001' - unable to convert reference to type 'class QuantLibAddin::OISRateHelper' found instead 'class QuantLibAddin::DatedOISRateHelper' Is this a known bug or am I doing something wrong? (3) I then tried to display the fixed leg and OIS leg schedules produced by the functions qlOvernightIndexedSwapFixedLegAnalysis and qlOvernightIndexedSwapOvernightLegAnalysis and noticed that the fixed leg 'Amount' and the 'Effective Rate' both show 0, which looks wrong. Is this a known bug? (4) Where the function qlOvernightIndexedSwapfromOISRateHelper successfully creates an OIS Swap object, I have attempted to value the fixed leg and overnight leg. First I set up a discounting swap engine using qlDiscountingSwapEngine and then tried to price each leg using qlOvernightIndexedSwapFixedLegNPV and qlOvernightIndexedSwapOvernightLegNPV respectively in order to confirm that these are equal. Although I seem to get a reasonable value for the overnight leg, the fixed leg NPV returns 0 which I think is wrong. Please advise on whether this is a bug. Note that I have separately tried to use qlMakeOIS and price the fixed leg and overnight leg separately, which seems to work, but it seemed natural to be able to directly price the relevant OIS instrument via the helper. Finally, I have some general questions on the use of QL Python/Excel (i) Is it possible to create a joint calendar in QL Excel and if so how do I do this? (ii) Is there a way to display the contents of an object in QL Excel? I noticed that there are some logging functions and was wondering whether these would serve this purpose? If so would you please provide an example, since I was unable to get these to work. (iii) Finally, in QL Python I am struggling to figure out what valid methods and attributes are applicable to objects. For example, if I create an OIS swap object using OISSwapObj =ql.MakeOIS(OISSwapTenor, OISSwapIndex, OISFixedRate), how would I know that I can obtain the NPV of this object using OISSwapObj.NPV() and what other methods(?) can I use? Is there a list that I can refer to, since I don't see this information in the QuantLib-Python Documentation page (www.quant lib-python-docs.readthedocs.io/en/latest)? For each accrual period I had wanted to display things like Accrual Start Date, Accrual End Date, Payment Date, Fixing Date, etc.. In other words, how do I get the same information out of this QL Python object that I can retrieve using something like qlOvernightIndexedSwapFixedLegAnalysis in QL Excel? Thanks in advance. Regards, Javid |