Examples of InterestRateFutureOptionMarginSecurity


Examples of com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity

    /**
     * Test the option price from the future price. Standard option.
     */
    public void priceStandard() {
      final double expirationTime = ACT_ACT.getDayCountFraction(REFERENCE_DATE, LAST_TRADING_DATE);
      final InterestRateFutureOptionMarginSecurity optionEDU2Standard = new InterestRateFutureOptionMarginSecurity(EDU2, expirationTime, STRIKE, IS_CALL);
      final double priceOption = METHOD.optionPrice(optionEDU2Standard, SABR_BUNDLE);
      final InterestRateFutureSecurityDiscountingMethod methodFuture = InterestRateFutureSecurityDiscountingMethod.getInstance();
      final double priceFuture = methodFuture.price(EDU2, CURVES_BUNDLE);
      final double priceOptionExpected = METHOD.optionPriceFromFuturePrice(optionEDU2Standard, SABR_BUNDLE, priceFuture);
      assertEquals("Future option with SABR volatilities: option price", priceOptionExpected, priceOption);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity

  @Override
  protected Set<ComputedValue> getResult(final InstrumentDerivative irFutureOptionTransaction, final YieldCurveWithBlackCubeBundle data, final ValueSpecification spec, Set<ValueRequirement> desiredValues) {
    Double gamma = null;
    if (irFutureOptionTransaction instanceof InterestRateFutureOptionMarginTransaction) {
      final InterestRateFutureOptionMarginSecurity irFutureOptionSecurity = ((InterestRateFutureOptionMarginTransaction) irFutureOptionTransaction).getUnderlyingOption();
      gamma = irFutureOptionSecurity.accept(CALCULATOR, data);
    } else {
      s_logger.error("Unexpected security type! {}", irFutureOptionTransaction.getClass());
    }
    return Collections.singleton(new ComputedValue(spec, gamma));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.