Package org.threeten.bp

Examples of org.threeten.bp.ZonedDateTime.plusDays()


    sb.append(putCurrency);
    sb.append("/");
    sb.append(callCurrency);
    sb.append(" @ ");
    sb.append(FORMATTER.format(strike));
    final FXOptionSecurity fxOption = new FXOptionSecurity(putCurrency, callCurrency, putAmount, callAmount, new Expiry(expiryDate), expiryDate.plusDays(2),
        random.nextBoolean(), new EuropeanExerciseType());
    fxOption.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    fxOption.setName(sb.toString());
    return fxOption;
  }
View Full Code Here


    final ValueProperties properties = createValueProperties()
        .with(CURVE_CONSTRUCTION_CONFIG, _configurationName)
        .get();
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.CURVE_CONSTRUCTION_CONFIG, ComputationTargetSpecification.NULL, properties);
    final Set<ComputedValue> result = Collections.singleton(new ComputedValue(spec, curveConstructionConfiguration));
    return new AbstractInvokingCompiledFunction(atZDT.with(LocalTime.MIDNIGHT), atZDT.plusDays(1).with(LocalTime.MIDNIGHT).minusNanos(1000000)) {

      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
          final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
        return result;
View Full Code Here

public class BucketedSpreadCurveFunction extends AbstractFunction {

  @Override
  public CompiledFunctionDefinition compile(final FunctionCompilationContext compilationContext, final Instant atInstant) {
    final ZonedDateTime atZDT = ZonedDateTime.ofInstant(atInstant, ZoneOffset.UTC);
    return new AbstractInvokingCompiledFunction(atZDT.with(LocalTime.MIDNIGHT), atZDT.plusDays(1).with(LocalTime.MIDNIGHT).minusNanos(1000000)) {

      @SuppressWarnings("synthetic-access")
      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
          final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
View Full Code Here

    ArgumentChecker.notNull(curves, "curves");
    // Do we want to include the CDS premium leg cashflow schedule as points
    final ZonedDateTime startDate = cds.getStartDate();
    ZonedDateTime endDate = cds.getMaturityDate();
    if (cds.getProtectionStart()) {
      endDate = endDate.plusDays(1);
    }
    // Calculate the schedule of integration timenodes for the accrued leg calculation
    return ScheduleUtils.constructISDACompliantAccruedLegIntegrationSchedule(curves, startDate, endDate);
  }
View Full Code Here

  private static final Logger s_logger = LoggerFactory.getLogger(ISDACreditSpreadCurveFunction.class);

  @Override
  public CompiledFunctionDefinition compile(final FunctionCompilationContext compilationContext, final Instant atInstant) {
    final ZonedDateTime atZDT = ZonedDateTime.ofInstant(atInstant, ZoneOffset.UTC);
    return new AbstractInvokingCompiledFunction(atZDT.with(LocalTime.MIDNIGHT), atZDT.plusDays(1).with(LocalTime.MIDNIGHT).minusNanos(1000000)) {

      @SuppressWarnings("synthetic-access")
      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
          final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
View Full Code Here

    while (dt.isBefore(endDate) || dt.equals(endDate)) {
      dates.add(dt);
      data.add(0.05 + Math.sin(dt.getDayOfYear()) / 100);
      dt = dt.plusDays(1);
      if (dt.getDayOfWeek().equals(DayOfWeek.SATURDAY)) {
        dt = dt.plusDays(2);
      }
    }
    return ImmutableZonedDateTimeDoubleTimeSeries.of(dates, data, ZoneOffset.UTC);
  }
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.