*/
public void profile() {
final Interpolator1D interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator(Interpolator1DFactory.DOUBLE_QUADRATIC, Interpolator1DFactory.LINEAR_EXTRAPOLATOR,
Interpolator1DFactory.LINEAR_EXTRAPOLATOR);
final SmileDeltaTermStructureParametersStrikeInterpolation smileTerm = TestsDataSetsForex.smile5points(REFERENCE_DATE, interpolator);
final SmileDeltaTermStructureDataBundle smileBundle = new SmileDeltaTermStructureDataBundle(CURVES, smileTerm, Pair.of(EUR, USD));
final int nbStrike = 100;
final double range = 0.40; // Spot = 1.40
final double shift = 2 * range / nbStrike;
final double[] strike = new double[nbStrike + 1];
final ForexOptionDigital[] forexOptionDigital = new ForexOptionDigital[nbStrike + 1];
final ForexOptionVanilla[] forexOptionVanilla = new ForexOptionVanilla[nbStrike + 1];
for (int loopstrike = 0; loopstrike <= nbStrike; loopstrike++) {
strike[loopstrike] = SPOT - range + loopstrike * shift;
final ForexDefinition forexDefinitonUSD = ForexDefinition.fromAmounts(EUR, USD, OPTION_EXP_DATE, -NOTIONAL / strike[loopstrike], NOTIONAL);
final ForexDefinition forexDefinitonEUR = ForexDefinition.fromAmounts(EUR, USD, OPTION_EXP_DATE, -1.0, strike[loopstrike]);
final ForexOptionDigitalDefinition forexOptionDigitalDefiniton = new ForexOptionDigitalDefinition(forexDefinitonUSD, OPTION_EXP_DATE, IS_CALL, IS_LONG);
final ForexOptionVanillaDefinition forexOptionVanillaDefiniton = new ForexOptionVanillaDefinition(forexDefinitonEUR, OPTION_EXP_DATE, IS_CALL, IS_LONG);
forexOptionDigital[loopstrike] = forexOptionDigitalDefiniton.toDerivative(REFERENCE_DATE, CURVES_NAME);
forexOptionVanilla[loopstrike] = forexOptionVanillaDefiniton.toDerivative(REFERENCE_DATE, CURVES_NAME);
}
final double[] pvDigitalSpread = new double[nbStrike + 1];
final double[] pvDigitalBlack = new double[nbStrike + 1];
final double[] pvVanillaBlack = new double[nbStrike + 1];
final double[] gammaDigitalSpread = new double[nbStrike + 1];
for (int loopstrike = 0; loopstrike <= nbStrike; loopstrike++) {
pvDigitalSpread[loopstrike] = METHOD_DIGITAL_SPREAD.presentValue(forexOptionDigital[loopstrike], smileBundle).getAmount(USD);
pvDigitalBlack[loopstrike] = METHOD_DIGITAL_BLACK.presentValue(forexOptionDigital[loopstrike], smileBundle).getAmount(USD);
pvVanillaBlack[loopstrike] = METHOD_VANILLA_BLACK.presentValue(forexOptionVanilla[loopstrike], smileBundle).getAmount(USD);
gammaDigitalSpread[loopstrike] = METHOD_DIGITAL_SPREAD.gamma(forexOptionDigital[loopstrike], smileBundle).getAmount();
}
final double dfDomestic = smileBundle.getCurve(forexOptionDigital[0].getUnderlyingForex().getPaymentCurrency2().getFundingCurveName()).getDiscountFactor(
forexOptionDigital[0].getUnderlyingForex().getPaymentTime());
final double dfForeign = smileBundle.getCurve(forexOptionDigital[0].getUnderlyingForex().getPaymentCurrency1().getFundingCurveName()).getDiscountFactor(
forexOptionDigital[0].getUnderlyingForex().getPaymentTime());
final double forward = SPOT * dfForeign / dfDomestic;
final double[] volBlack = new double[nbStrike + 1];
for (int loopstrike = 0; loopstrike <= nbStrike; loopstrike++) {
volBlack[loopstrike] = FXVolatilityUtils.getVolatility(smileBundle, EUR, USD, forexOptionDigital[loopstrike].getExpirationTime(), strike[loopstrike], forward);