Closed marcin-rybacki closed 3 months ago
Thanks! When the index has 0 intrinsic fixings days and observation shift is used, do you think it would be possible to use the telescopic property?
Thanks! When the index has 0 intrinsic fixings days and observation shift is used, do you think it would be possible to use the telescopic property?
I would say that is a corner case where telescopic property can be applied. Thank you for pointing that out. I will add a proper check.
Thanks! I assume all we need to give the same features to overnight interest swaps is to add the new parameters to the constructor and forward them to OvernightLeg, right? If so, I can do it if you're busy.
Thanks! I assume all we need to give the same features to overnight interest swaps is to add the new parameters to the constructor and forward them to OvernightLeg, right? If so, I can do it if you're busy.
Yes, I think that is all we need to do. I can do it still in this PR, if that's ok.
That would be great, thanks.
I'm guessing that quoted swaps can have these features, too, meaning that we'll need to support them in OISRateHelper as well—is this correct?
If that's the case, please have a look at #1998 and tell me if you think it's ok.
I'm guessing that quoted swaps can have these features, too, meaning that we'll need to support them in OISRateHelper as well—is this correct?
Good idea! Those features would be mostly added to issued bonds or loans, depending on the requirements of treasury departments. There could be some swaps offered to hedge those. Still, it's nice to have the helper support it.
In this PR I would like to add new functionality allowing to handle lookbacks, with and without observation shifts, and lockouts in the overnight indexed coupon.
The methodology for lookbacks and lockouts is outlined in a document by NY FED (pages 16-22). Excel examples, based on which the unit tests were created, can also be found on the NY FED website.
Lookback days do not need to define a separate member in the
OvernightIndexedCoupon
class, instead utilize thefixingDays_
member, because it already serves that purpose. It should be noted however that applying a lookback (with or without observation shift) might make it not possible to apply the telescopic formula and each fixing within the compounded coupon will have to be projected separately. This has to do with the fact that the value dates (and their accrual) over which the fixing is projected will no longer cancel out with the accrual of the interest period for that fixing.To further elaborate on this, we can define a single SOFR rate projection $F(T{i}^{V}, T{i+1}^{V})$ as:
$$ F(T{i}^{V}, T{i+1}^{V}) = \left [ \frac{P(t,T{i}^{V})}{P(t,T{i+1}^{V})} - 1 \right ]\frac{1}{\alpha (T{i}^{V}T{i+1}^{V})}, $$
where $P(t,T)$ is a discount factor at time $T$, and $\alpha (T{i}^{V},T{i+1}^{V})$ is a time fraction between value dates $T{i}^{V}$ and $T{i+1}^{V}$.
Now, if we consider the formula for the compounded rate $FC(T{J},T{K})$ over the coupon period $T{J},T{K}$:
$$ FC(T{J},T{K}) = \left [ \prod{k=J}^{K-1} \left ( 1+\alpha(T{k}^{I},T{k+1}^{I})F(T{k}^{V},T{k+1}^{V}) \right ) - 1 \right ] \frac{1}{\alpha (T{J},T_{K})},$$
we can see that each fixing in the compounded rate is accrued at $\alpha(T{i}^{I},T{i+1}^{I})$. In case where there's lookback the interest $T{i}^{I},T{i+1}^{I}$ and value date periods $T{i}^{V},T{i+1}^{V}$ will not be the same and the telescopic formula will not be applicable. Also in case of an observation shift these periods might not be the same. This has to do with the fact that value dates are defined relative to the fixing date based on the fixing delay of an interest rate index. When the lookback period in the coupon is different than the fixing delay in the index, even the observation shift will not align value dates with interest dates.
It can be shown that the same applies to lockout periods. Value dates (at which the projection is calculated) correspond to the locked-out fixing, while the interest dates (at which the interest over that fixing is accrued) are not fixed at lockout, hence they do not cancel out.
Where possible, I tried to enrich the comments in the code addressing those issues.
The changes to the coupon pricer are quite significant, so I would appreciate any feedback - also given the complexity of the calculations, especially for coupon projections. I implemented unit tests that should address the corner cases, but I might have omitted/overlooked something.
This PR addresses https://github.com/lballabio/QuantLib/issues/1422.