/** * 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.InterestRateFutureOptionMarginTransaction; import com.opengamma.analytics.financial.interestrate.future.provider.InterestRateFutureOptionMarginTransactionBlackSmileMethod; import com.opengamma.analytics.financial.provider.description.interestrate.BlackSTIRFuturesProviderInterface; /** * Calculates the position delta (first derivative of the price with respect to the underlying future price) for interest rate * future options. */ public final class PositionDeltaSTIRFutureOptionCalculator extends InstrumentDerivativeVisitorAdapter<BlackSTIRFuturesProviderInterface, Double> { /** * The unique instance of the calculator. */ private static final PositionDeltaSTIRFutureOptionCalculator INSTANCE = new PositionDeltaSTIRFutureOptionCalculator(); /** * Gets the calculator instance. * @return The calculator. */ public static PositionDeltaSTIRFutureOptionCalculator getInstance() { return INSTANCE; } /** * Constructor. */ private PositionDeltaSTIRFutureOptionCalculator() { } /** * Pricing methods. */ private static final InterestRateFutureOptionMarginTransactionBlackSmileMethod METHOD_STIR = InterestRateFutureOptionMarginTransactionBlackSmileMethod.getInstance(); @Override public Double visitInterestRateFutureOptionMarginTransaction(final InterestRateFutureOptionMarginTransaction futures, final BlackSTIRFuturesProviderInterface black) { return METHOD_STIR.presentValueDelta(futures, black); } }