Report generation on historical timeSeries


Hi ,

Is there any provision to generate report based on historical time series.
Like if i give the portfolio name , view name , from and to date and the source , i need to run a report on that and should be able to download it in CSV format.



There is nothing built-in to do that. You’ll need to create a utility that has access to all the sources (HistoricalTimeSeriesSource, PositionSource, SecuritySource) and then iterates over the portfolio (there are some helper classes for ‘walking’ a portfolio structure - see PortfolioNodeTraverser and PortfolioCompiler.resolvePortfolio()) loading the securities for each item. You can then use this as the basis to load the historical time series for each security using it’s ExternalIdBundle and output the resulting series using a CSVWriter.


Thanks for the pointers Jim.


In order to be able to compute historic data, how do we resolve the historic ccy rate? Do I need to create a new security ( e.g., EURUSD ) and then save a timeseries against that?

How does it get resolved, say for a EUR stock on 21.2.2010 requirement ( e.g., PnL) where the view is configured to return values as USD.

Also, what about other required historic data such as yield curves?



There are currently four different modes the engine can run in to get market data:

  • Live Data - data is sourced from an OpenGamma Live Data implementation
  • Historical Data - data is sourced from a HistoricalTimeSeriesSource implementation on the valuation date in question
  • Snapshot Data/User Data - data is sourced from a market data snapshot, which represents a sample of market data at a particular time. While our market data snapshot back-end and data integration is all open source and accessible via Java or REST APIs, there is a specialist front-end app for visualising and editing the market data snapshots that is a commercial component.
  • Combined - tries live data and falls through to historical data if live is not available.
These are all available via implementation of MarketDataSpecification that make up part of the ExecutionOptions passed to the engine when starting a view.

However, it’s worth noting that these modes don’t cover data that would normally always be considered historical. For example, the historical VaR calculation functions access the historical data source to calculate a PnL series directly rather than going via the engine. Similarly, sometimes a function requires a rate on a specific date - e.g. a fixing, where again, it will directly access the historical data source.

With regard to your specific question, you don’t need to create a security for a currency cross, only a historical time series. We will likely support for a ‘Quotable Object’ type security if, for no other reason than to provide id mappings. Currently the FX rates have to be specifically referred to in their Bloomberg form e.g. ‘EUR Curncy’ because of the lack of indirection via the security master. We’re aware this is not ideal and intend to add this ‘Quotable Object’ support during a general reworking of the security master structure in the next few months.


Got it - thanks Jim.
Am I right in thinking that the constituents of a yield curve can be dealt with as if they were ordinary securities?
Is there anything else that I need, once I have historic data for currencies and yield curves, so that I can calculate some simple analytics for simple cash securities in a batch for a given valuation date e.g., yday.
Thanks again