|
From: Luigi B. <lui...@gm...> - 2023-01-11 14:03:31
|
Hello Anastasia,
the index fixing used by the cashflow probably takes into account the
observation lag. CPI::laggedFixing will work, but it's still not exported
to Python in version 1.28. It will be available in version 1.29, hopefully
out in a week or two. In the meantime, you can do in Python what that
function does in C++ (the code is at <
https://github.com/lballabio/QuantLib/blob/QuantLib-v1.28/ql/indexes/inflationindex.cpp#L28>);
you'll also have to translate inflationPeriod (<
https://github.com/lballabio/QuantLib/blob/QuantLib-v1.28/ql/termstructures/inflationtermstructure.cpp#L349
>).
Hope this helps,
Luigi
On Tue, Jan 10, 2023 at 3:42 AM Anastasia Afanaseva <
ana...@di...> wrote:
> Hi!
>
> I have a problem with the CPI bond.
> I want to extract the index fixing on a daily basis (that fixing which is
> calculated within the cash flow including the inflation lag).
>
> If I apply the index.fixing(ql.Date(...) function, I get the value from
> the interpolated curve, but not the index which is taken into account when
> calculating the CPI coupon.
>
> Does the new method from version 1.26 laggedFixing solve this problem ? I
> did not get how it works, unfortunately.
>
> I have tried different options, ql.CPIBond.laggedFixing((index,
> ql.Date(31,12,2022), ql.Period(3, ql.Months), ql.CPI.Linear), but the
> errors like type object 'CPIBond' has no attribute 'laggedFixing' and
> others occur .
>
> Could anyone advise how to use this method correctly?
>
> Warm regards,
> Anastasia
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|