.with(MultiYieldCurvePropertiesAndDefaults.PROPERTY_USE_FINITE_DIFFERENCE, "false")
.get()), receiveCurveSpec,
receiveCurveMarketData, receiveHtsConversion);
// FXForwardCurveFromYieldCurveFunction
target = new ComputationTarget(ComputationTargetType.UNORDERED_CURRENCY_PAIR, UnorderedCurrencyPair.of(payCurrency, receiveCurrency));
final ForwardCurve fxForwardCurve = (ForwardCurve) execute(
execContext,
fxForwardCurveFromYieldCurveFunction,
target,
new ValueRequirement(ValueRequirementNames.FORWARD_CURVE, target.toSpecification(), ValueProperties.with(ValuePropertyNames.CURVE, getCurrencyCurveName()).get()),
payCurve,
receiveCurve,
new ComputedValue(ValueSpecification.of(ValueRequirementNames.SPOT_RATE, ComputationTargetType.PRIMITIVE,
UniqueId.of(spotRateIdentifier.getScheme().getName(), spotRateIdentifier.getValue()),
ValueProperties.with(ValuePropertyNames.FUNCTION, "SPOT").get()), spotRate.getSecond())).getValue();
double rate = fxForwardCurve.getForward(Period.between(spotRate.getFirst(), date).getDays() / YEAR_LENGTH);
if (!FXUtils.isInBaseQuoteOrder(currencies.getFirst(), currencies.getSecond())) {
rate = 1 / rate;
}
s_logger.debug("Calculated rate {} for {} on {}", new Object[] {rate, currencies, date });
return rate;