You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't actually tested this, but i believe this from reading the code. I will try to write a test case later, but i wanted to report this before i forget!
I am assuming that MakeVanillaSwap is still supported and intended to be used; i have not noticed that it is deprecated etc.
To use MakeVanillaSwap to create a swap with an explicit termination date, we call withTerminationDate; this sets the swapTenor_ field to a null value:
But in this case, for a swap with an explicit termination date, there is no valid swapTenor_, and what happens depends on how a null Period compares to non-null ones; i suspect that for sterling and Australian dollars, the tenor for short swaps will be picked, regardless of the actual tenor of the swap. This seems wrong to me.
I can see a couple of ways this could be changed.
Firstly, require an explicit fixed leg tenor if there is an explicit termination date. Thrown an assertion error otherwise.
Secondly, if there is an explicit termination date, work out an implicit swap tenor based on the effective and termination dates, and infer the fixed leg tenor from that.
Tangentially, i think it's a bit odd that this is all written in terms of leg tenor, rather than leg frequency, which is what is used in most other places i have seen, but it's not a big deal. I just wish there weren't so many different uses of "tenor" in this field!
The text was updated successfully, but these errors were encountered:
I haven't actually tested this, but i believe this from reading the code. I will try to write a test case later, but i wanted to report this before i forget!
I am assuming that MakeVanillaSwap is still supported and intended to be used; i have not noticed that it is deprecated etc.
To use MakeVanillaSwap to create a swap with an explicit termination date, we call withTerminationDate; this sets the
swapTenor_
field to a null value:When the swap is actually built, the fixed leg tenor is inferred based on conventions for the currency and swap tenor:
But in this case, for a swap with an explicit termination date, there is no valid
swapTenor_
, and what happens depends on how a nullPeriod
compares to non-null ones; i suspect that for sterling and Australian dollars, the tenor for short swaps will be picked, regardless of the actual tenor of the swap. This seems wrong to me.I can see a couple of ways this could be changed.
Firstly, require an explicit fixed leg tenor if there is an explicit termination date. Thrown an assertion error otherwise.
Secondly, if there is an explicit termination date, work out an implicit swap tenor based on the effective and termination dates, and infer the fixed leg tenor from that.
Tangentially, i think it's a bit odd that this is all written in terms of leg tenor, rather than leg frequency, which is what is used in most other places i have seen, but it's not a big deal. I just wish there weren't so many different uses of "tenor" in this field!
The text was updated successfully, but these errors were encountered: