Summary:
If the function getFutureBarrierProb of the GaussianCam model is applied to a fx rate whose source currency is identical to the base currency of the GaussianCam model, then the function getFutureBarrierProb only produces the probabilities 1 and 0.
Further Details:
The getFutureBarrierProb is used in the implementation of the scripted trade functions ABOVEPROB and BELOWPROB. If these are used in a fx barrier option with an American barrier, the barrier may silently degrade to an European barrier.
This behaviour is demonstrated by the example added as zip-file below. It computes the NPVs of two FX barrier options using the GaussianCam model. Both options have EUR/GBP as the underlying currency pair and differ only in their barrier-monitoring convention: one uses American-style monitoring, and the other uses European-style monitoring.
The script then checks whether the two NPVs are equal. It runs the calculation twice: once with GBP as the base currency and once with EUR as the base currency.
FxBarrier.zip
Running the script with v1.8.17.0 produces the following output:
Fix:
The getFutureBarrierProb of the GaussianCam model does not cover the case
(ind1 == Null<Size>() && ind2 != Null<Size>())
in the lines 879-903 of the file OREData/ored/scripting/models/gaussiancam.cpp. Due to the missing case, the variance remains zero during the computation of the barrier-hitting probability. The issue can be fixed by adding the missing case.
Summary:
If the function getFutureBarrierProb of the GaussianCam model is applied to a fx rate whose source currency is identical to the base currency of the GaussianCam model, then the function getFutureBarrierProb only produces the probabilities 1 and 0.
Further Details:
The getFutureBarrierProb is used in the implementation of the scripted trade functions ABOVEPROB and BELOWPROB. If these are used in a fx barrier option with an American barrier, the barrier may silently degrade to an European barrier.
This behaviour is demonstrated by the example added as zip-file below. It computes the NPVs of two FX barrier options using the GaussianCam model. Both options have EUR/GBP as the underlying currency pair and differ only in their barrier-monitoring convention: one uses American-style monitoring, and the other uses European-style monitoring.
The script then checks whether the two NPVs are equal. It runs the calculation twice: once with GBP as the base currency and once with EUR as the base currency.
FxBarrier.zip
Running the script with v1.8.17.0 produces the following output:
Fix:
The getFutureBarrierProb of the GaussianCam model does not cover the case
(ind1 == Null<Size>() && ind2 != Null<Size>())in the lines 879-903 of the file OREData/ored/scripting/models/gaussiancam.cpp. Due to the missing case, the variance remains zero during the computation of the barrier-hitting probability. The issue can be fixed by adding the missing case.