public interface MarketDataFactory
This component is used to create market data within Strata.
Each method receives a set of requirements defining the market data that is required.
This is typically obtained from CalculationTasks.requirements(ReferenceData).
Given the requirements, the factory will determine whether any raw market data is needed.
This may use the MarketDataConfig to provide additional information.
If raw market data is required, the ObservableDataProvider and TimeSeriesProvider
will be invoked to supply it. Applications can implement these to supply data from an external source.
Alternatively, the raw market data can be passed into each method using the suppliedData parameter.
Once the raw data is obtained, the factory will determine whether it needs to be calibrated,
which may also involve additional information from the MarketDataConfig.
Two types of output can be built.
The create method is used to obtain and calibrate a single set of market data.
By contrast, the createMultiScenario methods are used to create data with multiple
scenarios based on a ScenarioDefinition.
| Modifier and Type | Method and Description |
|---|---|
BuiltMarketData |
create(MarketDataRequirements requirements,
MarketDataConfig marketDataConfig,
MarketData suppliedData,
ReferenceData refData)
Builds a set of market data.
|
BuiltScenarioMarketData |
createMultiScenario(MarketDataRequirements requirements,
MarketDataConfig marketDataConfig,
MarketData suppliedData,
ReferenceData refData,
ScenarioDefinition scenarioDefinition)
Builds the market data required for performing calculations for a set of scenarios.
|
BuiltScenarioMarketData |
createMultiScenario(MarketDataRequirements requirements,
MarketDataConfig marketDataConfig,
ScenarioMarketData suppliedData,
ReferenceData refData,
ScenarioDefinition scenarioDefinition)
Builds the market data required for performing calculations for a set of scenarios.
|
static com.opengamma.strata.calc.marketdata.DefaultMarketDataFactory |
of(ObservableDataProvider observableDataProvider,
TimeSeriesProvider timeSeriesProvider,
List<MarketDataFunction<?,?>> functions)
Obtains an instance of the factory based on providers of market data and time-series.
|
static MarketDataFactory |
of(ObservableDataProvider observableDataProvider,
TimeSeriesProvider timeSeriesProvider,
MarketDataFunction<?,?>... functions)
Obtains an instance of the factory based on providers of market data and time-series.
|
static MarketDataFactory of(ObservableDataProvider observableDataProvider, TimeSeriesProvider timeSeriesProvider, MarketDataFunction<?,?>... functions)
The market data functions are used to build the market data.
observableDataProvider - the provider of observable market datatimeSeriesProvider - the provider of time-seriesfunctions - the functions that create the market datastatic com.opengamma.strata.calc.marketdata.DefaultMarketDataFactory of(ObservableDataProvider observableDataProvider, TimeSeriesProvider timeSeriesProvider, List<MarketDataFunction<?,?>> functions)
The market data functions are used to build the market data.
observableDataProvider - the provider of observable market datatimeSeriesProvider - the provider of time-seriesfunctions - the functions that create the market dataBuiltMarketData create(MarketDataRequirements requirements, MarketDataConfig marketDataConfig, MarketData suppliedData, ReferenceData refData)
This builds market data based on the specified requirements and configuration.
If some market data is known, it can be supplied using the MarketData interface.
Only data not already present in the suppliedData will be built.
requirements - the market data required for the calculationsmarketDataConfig - configuration needed to build non-observable market data, for example curves or surfacessuppliedData - market data supplied by the userrefData - the reference dataBuiltScenarioMarketData createMultiScenario(MarketDataRequirements requirements, MarketDataConfig marketDataConfig, MarketData suppliedData, ReferenceData refData, ScenarioDefinition scenarioDefinition)
This builds market data based on the specified requirements and configuration.
If some market data is known, it can be supplied using the MarketData interface.
Only data not already present in the suppliedData will be built.
The scenario definition will be applied, potentially generating multiple sets of market data.
If the scenario definition contains perturbations that apply to the inputs used to build market data,
the data must be built by this method, not provided in suppliedData.
For example, if a perturbation is defined that shocks the par rates used to build a curve, the curve
must not be provided in suppliedData. The factory will only build the curve using the par rates
if it is not found in suppliedData.
requirements - the market data required for the calculationsmarketDataConfig - configuration needed to build non-observable market data, for example curves or surfacessuppliedData - the base market data used to derive the data for each scenariorefData - the reference datascenarioDefinition - defines how the market data for each scenario is derived from the base dataBuiltScenarioMarketData createMultiScenario(MarketDataRequirements requirements, MarketDataConfig marketDataConfig, ScenarioMarketData suppliedData, ReferenceData refData, ScenarioDefinition scenarioDefinition)
This builds market data based on the specified requirements and configuration.
If some market data is known, it can be supplied using the ScenarioMarketData interface.
Only data not already present in the suppliedData will be built.
The scenario definition will be applied, potentially generating multiple sets of market data.
The number of scenarios in the supplied data must match that of the scenario definition.
If the scenario definition contains perturbations that apply to the inputs used to build market data,
the data must be built by this method, not provided in suppliedData.
For example, if a perturbation is defined that shocks the par rates used to build a curve, the curve
must not be provided in suppliedData. The factory will only build the curve using the par rates
if it is not found in suppliedData.
requirements - the market data required for the calculationsmarketDataConfig - configuration needed to build non-observable market data, for example curves or surfacessuppliedData - the base market data used to derive the data for each scenariorefData - the reference datascenarioDefinition - defines how the market data for each scenario is derived from the base dataCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.