Package com.opengamma.engine.marketdata.spec

Examples of com.opengamma.engine.marketdata.spec.MarketDataSpecification


      List<ViewCycleExecutionOptions> executionSequence = new LinkedList<ViewCycleExecutionOptions>();
      LocalDate previousWorkingDate = null;
      LocalDate currentDate = startDate;
      while (!currentDate.isAfter(endDate)) {
        if (calendar == null || calendar.isWorkingDay(currentDate)) {
          MarketDataSpecification marketDataSpec = createMarketDataSpec(previousWorkingDate, currentDate, LocalDate.now(executionContext.getValuationClock()));
          if (marketDataSpec != null) {
            ViewCycleExecutionOptions executionOptions = ViewCycleExecutionOptions.builder()
                .setMarketDataSpecification(marketDataSpec)
                .create();
            executionSequence.add(executionOptions);
View Full Code Here


    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
 
  @Path("marketDataLiveDefault")
  public DependencyGraphTraceProviderResource setMarketDataLiveDefault() {
    MarketDataSpecification marketData = MarketData.live();
    DependencyGraphTraceBuilderProperties properties = _properties.addMarketData(marketData);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here

    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
 
  @Path("marketDataLive/{dataSource}")
  public DependencyGraphTraceProviderResource setMarketDataLive(@PathParam("dataSource") final String dataSource) {
    MarketDataSpecification marketData = MarketData.live(dataSource);
    DependencyGraphTraceBuilderProperties properties = _properties.addMarketData(marketData);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here

  }

  @Path("marketDataHistorical/{localDate}/{timeSeriesResolverKey}")
  public DependencyGraphTraceProviderResource setMarketDataHistorical(@PathParam("localDate") final String localDateStr, @PathParam("timeSeriesResolverKey") final String timeSeriesResolverKey) {
    LocalDate localDate = LocalDate.parse(localDateStr);
    MarketDataSpecification marketData = MarketData.historical(localDate, timeSeriesResolverKey);
    DependencyGraphTraceBuilderProperties properties = _properties.addMarketData(marketData);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here

      graph.addDependencyNode(node);
      previous = node;
    }
    final CompiledViewDefinitionWithGraphsImpl viewEvaluationModel = new CompiledViewDefinitionWithGraphsImpl(VersionCorrection.LATEST, "", viewDefinition, Collections.singleton(graph),
        Collections.<ComputationTargetReference, UniqueId>emptyMap(), new SimplePortfolio("Test Portfolio"), 0);
    final ViewCycleExecutionOptions cycleOptions = ViewCycleExecutionOptions.builder().setValuationTime(Instant.ofEpochMilli(1)).setMarketDataSpecification(new MarketDataSpecification()).create();
    final SingleComputationCycle cycle = new SingleComputationCycle(UniqueId.of("Test", "Cycle1"), computationCycleResultListener, vpc, viewEvaluationModel,
        cycleOptions, VersionCorrection.of(Instant.ofEpochMilli(1), Instant.ofEpochMilli(1)));
    return factory.createExecutor(cycle).execute(graph);
  }
View Full Code Here

  @BeforeMethod
  public void setUp() throws Exception {
    _manager = new MarketDataManager(createChangeListener(), createResolver(), null, null);
    _manager.createSnapshotManagerForCycle(new UserPrincipal("bloggs", "127.0.0.1"),
                                           ImmutableList.of(new MarketDataSpecification()));
  }
View Full Code Here

      outputFile = new File(outputOption);
    } else {
      outputFile = new File(DEFAULT_OUTPUT_NAME + "." + ResultFormat.of(format).getExtension());
    }
   
    MarketDataSpecification marketDataSpec = getMarketDataSpecification(commandLine, toolContext);
    return new ViewStatusOption(portfolioName, format, user, aggregateType, outputFile, marketDataSpec);
  }
View Full Code Here

    List<MarketDataSpecification> marketDataSpecifications = cycleExecutionOptions.getMarketDataSpecifications();
    if (marketDataSpecifications.size() != 1) {
      throw new OpenGammaRuntimeException("Expected cycle execution options to contain exactly 1 market data specification but found " +
          marketDataSpecifications.size() + ": " + cycleExecutionOptions);
    }
    MarketDataSpecification marketDataSpec = marketDataSpecifications.get(0);
    if (marketDataSpec instanceof FixedHistoricalMarketDataSpecification) {
      return ((FixedHistoricalMarketDataSpecification) marketDataSpec).getSnapshotDate();
    } else if (marketDataSpec instanceof HistoricalShockMarketDataSpecification) {
      MarketDataSpecification spec2 = ((HistoricalShockMarketDataSpecification) marketDataSpec).getHistoricalSpecification2();
      if (spec2 instanceof FixedHistoricalMarketDataSpecification) {
        return ((FixedHistoricalMarketDataSpecification) spec2).getSnapshotDate();
      } else {
        throw new OpenGammaRuntimeException("Unsupported inner market data specification: " + spec2);
      }
View Full Code Here

    } else {
      valuationInstant = Instant.now();
    }
    final boolean historicalInput = getCommandLine().hasOption(HISTORICAL_OPTION);

    final MarketDataSpecification marketDataSpecification = historicalInput ? new LatestHistoricalMarketDataSpecification() : MarketData.live();
    final ViewExecutionOptions viewExecutionOptions = ExecutionOptions.singleCycle(valuationInstant, marketDataSpecification, EnumSet.of(ViewExecutionFlags.AWAIT_MARKET_DATA));

    final List<RemoteViewProcessor> viewProcessors = getRemoteComponentFactory().getViewProcessors();
    if (viewProcessors.size() == 0) {
      s_logger.warn("No view processors found at {}", getRemoteComponentFactory().getBaseUri());
View Full Code Here

      appContext.start();

      ViewProcessor viewProcessor = appContext.getBean("viewProcessor", ViewProcessor.class);

      ViewClient viewClient = viewProcessor.createViewClient(UserPrincipal.getLocalUser());
      MarketDataSpecification marketDataSpec = new FixedHistoricalMarketDataSpecification(s_observationDateTime.toLocalDate());
      ViewCycleExecutionOptions cycleOptions = ViewCycleExecutionOptions.builder().setValuationTime(s_valuationInstant).setMarketDataSpecification(marketDataSpec)
          .setResolverVersionCorrection(VersionCorrection.of(s_versionAsOf, s_correctedTo)).create();
      ViewCycleExecutionSequence executionSequence = ArbitraryViewCycleExecutionSequence.of(cycleOptions);

      ExecutionOptions executionOptions = new ExecutionOptions(executionSequence, ExecutionFlags.none().awaitMarketData().get(), null, null);
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.spec.MarketDataSpecification

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.