/** * Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.provider.calculator.blackstirfutures; import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity; import com.opengamma.analytics.financial.interestrate.future.provider.InterestRateFutureOptionMarginSecurityBlackRateMethod; import com.opengamma.analytics.financial.provider.description.interestrate.BlackSTIRFuturesProviderInterface; /** * Calculates the delta (first derivative of the price with respect to the underlying future price) for interest rate * future options. */ public final class DeltaSTIRFutureOptionCalculator extends InstrumentDerivativeVisitorAdapter<BlackSTIRFuturesProviderInterface, Double> { /** * The unique instance of the calculator. */ private static final DeltaSTIRFutureOptionCalculator INSTANCE = new DeltaSTIRFutureOptionCalculator(); /** * Gets the calculator instance. * @return The calculator. */ public static DeltaSTIRFutureOptionCalculator getInstance() { return INSTANCE; } /** * Constructor. */ private DeltaSTIRFutureOptionCalculator() { } /** * Pricing methods. */ private static final InterestRateFutureOptionMarginSecurityBlackRateMethod METHOD_STIR_MARGIN = InterestRateFutureOptionMarginSecurityBlackRateMethod.getInstance(); @Override public Double visitInterestRateFutureOptionMarginSecurity(final InterestRateFutureOptionMarginSecurity futures, final BlackSTIRFuturesProviderInterface black) { return METHOD_STIR_MARGIN.priceDelta(futures, black); } }