Package com.opengamma.analytics.financial.simpleinstruments.derivative

Examples of com.opengamma.analytics.financial.simpleinstruments.derivative.SimpleFuture


  public SimpleFuture toDerivative(final ZonedDateTime date) {
    Validate.notNull(date, "date");
    Validate.isTrue(date.isBefore(_expiryDate));
    double timeToFixing = TimeCalculator.getTimeBetween(date, _expiryDate);
    double timeToDelivery = TimeCalculator.getTimeBetween(date, _settlementDate);
    return new SimpleFuture(timeToFixing, timeToDelivery, _referencePrice, _unitAmount, _currency);
  }
View Full Code Here


  public SimpleFuture toDerivative(final ZonedDateTime date, final double referencePrice) {
    Validate.notNull(date, "date");
    Validate.isTrue(date.isBefore(_expiryDate));
    double timeToFixing = TimeCalculator.getTimeBetween(date, _expiryDate);
    double timeToDelivery = TimeCalculator.getTimeBetween(date, _settlementDate);
    return new SimpleFuture(timeToFixing, timeToDelivery, referencePrice, _unitAmount, _currency);
  }
View Full Code Here

    return s_instance;
  }

  @Override
  public SimpleFuture visitAgricultureFuture(final AgricultureFuture future) {
    return new SimpleFuture(future.getExpiry(), future.getSettlement(), future.getReferencePrice(), future.getUnitAmount(), future.getCurrency());
  }
View Full Code Here

    return new SimpleFuture(future.getExpiry(), future.getSettlement(), future.getReferencePrice(), future.getUnitAmount(), future.getCurrency());
  }

  @Override
  public SimpleFuture visitEnergyFuture(final EnergyFuture future) {
    return new SimpleFuture(future.getExpiry(), future.getSettlement(), future.getReferencePrice(), future.getUnitAmount(), future.getCurrency());
  }
View Full Code Here

    return new SimpleFuture(future.getExpiry(), future.getSettlement(), future.getReferencePrice(), future.getUnitAmount(), future.getCurrency());
  }

  @Override
  public SimpleFuture visitMetalFuture(final MetalFuture future) {
    return new SimpleFuture(future.getExpiry(), future.getSettlement(), future.getReferencePrice(), future.getUnitAmount(), future.getCurrency());
  }
View Full Code Here

    super(ValueRequirementNames.PV01);
  }

  @Override
  protected Double computeValues(InstrumentDerivative derivative, SimpleFutureDataBundle market) {
    SimpleFuture simpleFuture = derivative.accept(SimpleFutureConverter.getInstance());
    return simpleFuture.getSettlement() * market.getMarketPrice() / 10000.0;
  }
View Full Code Here

    return derivative.getSettlement() * market.getMarketPrice();
  }

  @Override
  protected Object computeValues(InstrumentDerivative derivative, SimpleFutureDataBundle market) {
    SimpleFuture simpleFuture = derivative.accept(SimpleFutureConverter.getInstance());
    return simpleFuture.getSettlement() * market.getMarketPrice();
  }
View Full Code Here

    return derivative.getUnitAmount();
  }

  @Override
  protected Double computeValues(InstrumentDerivative derivative, SimpleFutureDataBundle market) {
    SimpleFuture simpleFuture = derivative.accept(SimpleFutureConverter.getInstance());
    return simpleFuture.getUnitAmount();
  }
View Full Code Here

  private static final CommodityFuturePresentValueCalculator CALCULATOR = new CommodityFuturePresentValueCalculator();

  @Override
  protected Object computeValues(InstrumentDerivative derivative, SimpleFutureDataBundle market) {
    SimpleFuture simpleFuture = derivative.accept(SimpleFutureConverter.getInstance());
    final Double pv = simpleFuture.accept(CALCULATOR, market);
    return pv;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.simpleinstruments.derivative.SimpleFuture

Copyright © 2018 www.massapicom. 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.