Hi,
I’m trying to use QuantLib 1.6 to calibrate G2++ with european
swaptions in the current market
condition where we have negative swap rates.
I wrote my code like the
one for Bermudan Swaptions example and I
provide ATM bp vols. When the calibration
starts, it fails as the strikes are negative.
If fails as it uses the blackformula object where the function checkParameters is called in the function
blackFormula.
QL_REQUIRE(strike
+ displacement >= 0.0,
"strike + displacement (" << strike << "
+ " << displacement
<< ")
must be non-negative");
The value of the strike is negative, and the displacement =
0. I saw that we have in the same class, a function named
bachelierBlackFormula that does not require any special condition on the
strike.
Question : how can I make quantlib call this function
instead of blackFormula when creating swaption engines?
Many thanks in advance for your answer and suggestions.
Kind regards,
MG