if (optionDigital.payDomestic()) {
amountPaid = Math.abs(optionDigital.getUnderlyingForex().getPaymentCurrency2().getAmount());
strikeRelM = strikeM;
strikeRelP = strikeP;
final double amount = amountPaid / (strikeRelP - strikeRelM);
final Forex forexM = new Forex(optionDigital.getUnderlyingForex().getPaymentCurrency1().withAmount(amount),
optionDigital.getUnderlyingForex().getPaymentCurrency2().withAmount(-strikeRelM * amount));
final Forex forexP = new Forex(optionDigital.getUnderlyingForex().getPaymentCurrency1().withAmount(amount),
optionDigital.getUnderlyingForex().getPaymentCurrency2().withAmount(-strikeRelP * amount));
callSpread[0] = new ForexOptionVanilla(forexM, optionDigital.getExpirationTime(), optionDigital.isCall(),
(optionDigital.isLong() == optionDigital.isCall()));
callSpread[1] = new ForexOptionVanilla(forexP, optionDigital.getExpirationTime(), optionDigital.isCall(),
!(optionDigital.isLong() == optionDigital.isCall()));
} else {
amountPaid = Math.abs(optionDigital.getUnderlyingForex().getPaymentCurrency1().getAmount());
strikeRelM = 1.0 / strikeP;
strikeRelP = 1.0 / strikeM;
final double amount = amountPaid / (strikeRelP - strikeRelM);
final Forex forexM = new Forex(optionDigital.getUnderlyingForex().getPaymentCurrency2().withAmount(amount),
optionDigital.getUnderlyingForex().getPaymentCurrency1().withAmount(-strikeRelM * amount));
final Forex forexP = new Forex(optionDigital.getUnderlyingForex().getPaymentCurrency2().withAmount(amount),
optionDigital.getUnderlyingForex().getPaymentCurrency1().withAmount(-strikeRelP * amount));
callSpread[0] = new ForexOptionVanilla(forexM, optionDigital.getExpirationTime(), !optionDigital.isCall(),
!(optionDigital.isLong() == optionDigital.isCall()));
callSpread[1] = new ForexOptionVanilla(forexP, optionDigital.getExpirationTime(), !optionDigital.isCall(),
(optionDigital.isLong() == optionDigital.isCall()));