Conversation
|
Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it. |
|
@lballabio Looking forward to your feedback :) |
Thanks! I will, probably not very soon since I'm on holiday this couple of weeks. |
lballabio
left a comment
There was a problem hiding this comment.
Thanks! I left a few comments in the files.
| bool isFxBaseCurrencyLegResettable, | ||
| Real fxBaseNominal = 1.0, | ||
| const Period& forwardStart = 0 * Days); |
There was a problem hiding this comment.
These three (or at least the last two, since they have a default value) can probably be additional methods instead of constructor arguments. I know there are similar arguments in MakeVanillaSwap for instance, but in hindsight that might have been a mistake.
The same goes for the other swaps.
| "the FX spot quote must be positive; got " << fxSpot_->value()); | ||
| fxQuoteNominal = fxBaseNominal_ * fxSpot_->value(); | ||
| } else { | ||
| QL_REQUIRE(fxBaseCcy == fxQuoteCcy, |
There was a problem hiding this comment.
I'm not sure I would allow the currencies to be the same. It's not a XCCY swap in this case. I'd probably check this earlier and throw if they're the same.
The same goes for the other swaps.
| QL_REQUIRE(fxSpot_->value() > 0.0, | ||
| "the FX spot quote must be positive; got " << fxSpot_->value()); | ||
| fxQuoteNominal = fxBaseNominal_ * fxSpot_->value(); | ||
| } else { |
There was a problem hiding this comment.
We might also have the case in which both an FX quote nominal and an FX spot were passed. I'd probably throw in that case.
| @@ -0,0 +1,433 @@ | |||
| /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |||
|
|
|||
| /* | |||
There was a problem hiding this comment.
We need a copyright attribution here and in the other new files.
| pair of indices, see \c MakeConstNotionalCrossCurrencyBasisSwap and | ||
| \c MakeConstNotionalCrossCurrencyFixedVsFloatingSwap. | ||
| */ | ||
| class MakeConstNotionalCrossCurrencySwap { |
There was a problem hiding this comment.
I'm not sure this one is worth having, given all the previous work that goes into creating the legs.
Feature: #2717
Summary
Adds fluent
Make*builders for cross-currency swaps (same pattern asMakeVanillaSwap/MakeOIS).What's added
MakeConstNotionalCrossCurrencyBasisSwap— float vs floatMakeConstNotionalCrossCurrencyFixedVsFloatingSwap— fixed vs floatMakeConstNotionalCrossCurrencySwap— generic pre-built legsMakeMtMCrossCurrencyBasisSwap— resetting-notional basis swap