Class AMarketDataPostProcessor
- java.lang.Object
-
- com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor<OutputType>
-
- com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<com.qfs.vector.IVector>
-
- com.activeviam.risk.core.postprocessor.impl.AMarketDataPostProcessor
-
- All Implemented Interfaces:
IMaturityConverterAware
,ITenorUtilAware
,IPnLExplainFormulaProviderAware
,com.quartetfs.biz.pivot.postprocessing.IAggregatedMeasureAware
,com.quartetfs.biz.pivot.postprocessing.IBasicPostProcessor<com.qfs.vector.IVector>
,com.quartetfs.biz.pivot.postprocessing.IEvaluator<com.qfs.vector.IVector>
,com.quartetfs.biz.pivot.postprocessing.IPartitionedPostProcessor<com.qfs.vector.IVector>
,com.quartetfs.biz.pivot.postprocessing.IPostProcessor<com.qfs.vector.IVector>
,com.quartetfs.fwk.types.IExtendedPluginValue
,Serializable
- Direct Known Subclasses:
BiDimensionalMarketDataPostProcessor
,SingleDimensionMarketDataPostProcessor
,TriDimensionalMarketDataPostProcessor
public abstract class AMarketDataPostProcessor extends com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<com.qfs.vector.IVector> implements ITenorUtilAware, IMaturityConverterAware, IPnLExplainFormulaProviderAware
Abstract Post-processor used to get market data for current and previous date values. It is implemented by DeltaGamma and Vega market data postprocessors.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor
BASIC_POST_PROCESSOR_PREFETCHER, isPartitionedOnRangeLevels
-
Fields inherited from class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor
aggregatedMeasureName, ANALYSIS_LEVELS_PROPERTY, analysisLevelsToExpand, continuousQueryHandlerKeys, derivedContextDependencies, evaluator, EVALUATOR, explicitContextDependencies, logger, measuresProvider, name, OUTPUT_TYPE, outputType, pivot, prefetchers, PRINT_TIMINGS, printTimings, properties, underlyingMeasures
-
Fields inherited from interface com.activeviam.risk.core.dates.IMaturityConverterAware
PROPERTY_NAME
-
Fields inherited from interface com.quartetfs.biz.pivot.postprocessing.IPartitionedPostProcessor
DEFAULT_PARTITIONING_ON_RANGE_LEVELS
-
Fields inherited from interface com.activeviam.risk.core.services.IPnLExplainFormulaProviderAware
PROPERTY_NAME
-
Fields inherited from interface com.quartetfs.biz.pivot.postprocessing.IPostProcessor
CONTINUOUS_QUERY_HANDLER_KEYS, IS_PARTITIONED_ON_RANGE_LEVELS_PROPERTY, SEPARATOR, UNDERLYING_MEASURES
-
Fields inherited from interface com.activeviam.risk.core.dates.ITenorUtilAware
PROPERTY_NAME
-
-
Constructor Summary
Constructors Constructor Description AMarketDataPostProcessor(String name, com.quartetfs.biz.pivot.cube.hierarchy.measures.IPostProcessorCreationContext creationContext)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TreeMap<Double,Integer>
convertBucketToMaturity(String[] buckets, BucketType bucketType, LocalDate asOfDate)
protected TreeMap<Double,Integer>
convertBucketToMaturity(Map<String,Integer> buckets, BucketType bucketType, LocalDate asOfDate)
protected abstract com.qfs.vector.IVector
doEvaluate(com.quartetfs.biz.pivot.ILocation location, LocalDate asOfDate, String marketDataSet, String riskFactor, String riskClass, String sensitivityName)
com.qfs.vector.IVector
evaluate(com.quartetfs.biz.pivot.ILocation leafLocation, Object[] underlyingMeasures)
There is only one underlying measure here: the Double Sensi Value .protected Optional<com.qfs.store.record.IRecordReader>
getMarketDataRecord(LocalDate date, String marketDataSet, String riskFactor)
Method that retrieves the market data for the current dayprotected static com.activeviam.desc.build.ICanStartBuildingMeasures.BuildablePostProcessorBuilder
getPostProcessorDescription(com.activeviam.desc.build.ICanStartBuildingMeasures builder, String pluginKey, String measureName, String underlyingMeasures, String asOfDateLevel, String marketDataSetLevel, String riskFactorLevel, String riskClassLevel, Integer maxFallbackDays, String dateInfo, String sensitivityName, String marketDataStoreName, String[] marketDataStoreFields, String tenorAndMaturityDefaultValue, String sensitivityNameLevelInfo, String interpolationDebugStringIdentifier, String formatter, String folder)
This will create a PP configurationvoid
init(Properties properties)
Three custom property needs to be present in the configuration of the post-processor: keyLeafLevels: It's the value representing the key levels: AsOfDate, Risk Factor e.g.
"AsOfDate@Date@Dates", "RiskFactor@Risk Factor@Risk" * DateInfo: its value is the string representing the date property (either current date or precious date) e.g.
"currentDate" SensitivityName: its value is the string representing the sensi type, e.g.
"Delta", "Vega", "Gamma" * MaxFallback days: its value is the string representing the maximum fallback days for previous date market data.protected static com.activeviam.copper.api.CopperPostProcessor
measure(String pluginKey, com.activeviam.copper.api.CopperMeasure underlyingMeasures, String asOfDateLevel, String marketDataSetLevel, String riskFactorLevel, String riskClassLevel, Integer maxFallbackDays, String dateInfo, String sensitivityName, String marketDataStoreName, String[] marketDataStoreFields, String tenorAndMaturityDefaultValue, String sensitivityNameLevelInfo, String interpolationDebugStringIdentifier)
This will create a PP configurationvoid
setMaturityConverter(IMaturityConverter maturityConverter)
Set the implementation ofIMaturityConverter
void
setPnLExplainFormulaProvider(IPnLExplainFormulaProvider provider)
Set the implementation ofIPnLExplainFormulaProvider
void
setTenorUtil(ITenorUtil tenorUtil)
Set the implementation ofITenorUtil
protected LocalDate
stepDate(LocalDate date, boolean first)
Step the as-of date forward or backwards according todateProperty
.-
Methods inherited from class com.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor
checkPrefetchers, compute, computePrefetchFilter, createPrefetchers, createProcedure, evaluate, initializeUnderlyingMeasures, reduce, setPartitioningLevels, supportsAnalysisLevels
-
Methods inherited from class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor
addContextDependency, checkInterruption, checkOutputType, computeNamePath, computeOutputType, createEvaluator, expandResult, getActivePivot, getContext, getContextDependencies, getContinuousQueryHandlerKeys, getCurrentMeasure, getDatastoreVersion, getDerivedContextDependencies, getExpansionProcedure, getGenericOutputType, getMeasuresProvider, getName, getOutputType, getOutputTypeFromGenericClassParameter, getOutputTypeFromProperties, getPrefetchers, getProperties, getQueryCache, getTypeFromClass, handleCircularDependency, handleNotSupportedAnalysisLevels, handleUnknownUnderlyingMeasure, hideEvaluator, initializeContinuousQueryHandlerKeys, removeAnalysisLevelsFromFilter, restrictLocationAnalysisLevels, retrieveAnalysisLevelsToExpand, retrieveNamedPrefetchAggregatesWithAnalysisLevels, retrievePrefetchAggregates, retrievePrefetchAggregatesWithAnalysisLevels, setAggregatedMeasureName, toString
-
-
-
-
Field Detail
-
KEY_LEAF_LEVELS
public static final String KEY_LEAF_LEVELS
- See Also:
- Constant Field Values
-
DATE_INFO
public static final String DATE_INFO
- See Also:
- Constant Field Values
-
SENSITIVITY_NAME_PROPERTY
public static final String SENSITIVITY_NAME_PROPERTY
- See Also:
- Constant Field Values
-
MAX_FALLBACK_DAYS
public static final String MAX_FALLBACK_DAYS
- See Also:
- Constant Field Values
-
MARKET_DATA_STORE_NAME
public static final String MARKET_DATA_STORE_NAME
- See Also:
- Constant Field Values
-
MARKET_DATA_STORE_FIELDS
public static final String MARKET_DATA_STORE_FIELDS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FALLBACK_DAYS
public static final String DEFAULT_MAX_FALLBACK_DAYS
- See Also:
- Constant Field Values
-
SENSITIVITY_NAME_LEVEL
public static final String SENSITIVITY_NAME_LEVEL
- See Also:
- Constant Field Values
-
PERFORM_INTERPOLATION
public static final String PERFORM_INTERPOLATION
- See Also:
- Constant Field Values
-
IDENTIFIER
public static final String IDENTIFIER
- See Also:
- Constant Field Values
-
TENOR_AND_MATURITY_DEFAULT_VALUE
public static final String TENOR_AND_MATURITY_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
asOfDateLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo asOfDateLevelInfo
-
marketDataSetLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo marketDataSetLevelInfo
-
riskFactorLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo riskFactorLevelInfo
-
sensitivityNameLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo sensitivityNameLevelInfo
-
riskClassLevelInfo
protected com.quartetfs.biz.pivot.cube.hierarchy.ILevelInfo riskClassLevelInfo
-
maxFallbackDays
protected int maxFallbackDays
-
sensitivityName
protected String sensitivityName
-
dateProperty
protected String dateProperty
-
marketDataStoreName
protected String marketDataStoreName
-
tenorUtil
protected ITenorUtil tenorUtil
-
maturityConverter
protected IMaturityConverter maturityConverter
-
quoteField
protected String quoteField
-
identifier
protected String identifier
-
provider
protected IPnLExplainFormulaProvider provider
-
tenorAndMaturityDefaultValue
protected String tenorAndMaturityDefaultValue
-
-
Constructor Detail
-
AMarketDataPostProcessor
public AMarketDataPostProcessor(String name, com.quartetfs.biz.pivot.cube.hierarchy.measures.IPostProcessorCreationContext creationContext)
-
-
Method Detail
-
getPostProcessorDescription
protected static com.activeviam.desc.build.ICanStartBuildingMeasures.BuildablePostProcessorBuilder getPostProcessorDescription(com.activeviam.desc.build.ICanStartBuildingMeasures builder, String pluginKey, String measureName, String underlyingMeasures, String asOfDateLevel, String marketDataSetLevel, String riskFactorLevel, String riskClassLevel, Integer maxFallbackDays, String dateInfo, String sensitivityName, String marketDataStoreName, String[] marketDataStoreFields, String tenorAndMaturityDefaultValue, String sensitivityNameLevelInfo, String interpolationDebugStringIdentifier, String formatter, String folder)
This will create a PP configuration- Parameters:
builder
- measure builderpluginKey
- plugin keymeasureName
- Name of the postprocessorunderlyingMeasures
- The underlying measureasOfDateLevel
- Level containing the asOfSDatemarketDataSetLevel
- Level containing the market data set levelriskFactorLevel
- risk factor levelriskClassLevel
- risk class levelmaxFallbackDays
- max fallback daysdateInfo
- date infosensitivityName
- sensitivity namemarketDataStoreName
- market data store namemarketDataStoreFields
- market data store fieldstenorAndMaturityDefaultValue
- default value for tenors and maturitiessensitivityNameLevelInfo
- sensitivity name level infointerpolationDebugStringIdentifier
- internal identifier used in the query cache. The keys in the query cache that will be used have the following pattern: measure name + identifier + locationformatter
- formatterfolder
- Folder name of the metric, if not provider aka null measure is invisible- Returns:
- post processor description
-
measure
protected static com.activeviam.copper.api.CopperPostProcessor measure(String pluginKey, com.activeviam.copper.api.CopperMeasure underlyingMeasures, String asOfDateLevel, String marketDataSetLevel, String riskFactorLevel, String riskClassLevel, Integer maxFallbackDays, String dateInfo, String sensitivityName, String marketDataStoreName, String[] marketDataStoreFields, String tenorAndMaturityDefaultValue, String sensitivityNameLevelInfo, String interpolationDebugStringIdentifier)
This will create a PP configuration- Parameters:
pluginKey
- plugin keyunderlyingMeasures
- The underlying measureasOfDateLevel
- Level containing the asOfSDatemarketDataSetLevel
- Level containing the market data set levelriskFactorLevel
- risk factor levelriskClassLevel
- risk class levelmaxFallbackDays
- max fallback daysdateInfo
- date infosensitivityName
- sensitivity namemarketDataStoreName
- market data store namemarketDataStoreFields
- market data store fieldstenorAndMaturityDefaultValue
- default value for tenors and maturitiessensitivityNameLevelInfo
- sensitivity name level infointerpolationDebugStringIdentifier
- internal identifier used in the query cache. The keys in the query cache that will be used have the following pattern: measure name + identifier + location- Returns:
- post processor description
-
init
public void init(Properties properties) throws com.quartetfs.fwk.QuartetException
Three custom property needs to be present in the configuration of the post-processor:- keyLeafLevels: It's the value representing the key levels: AsOfDate, Risk Factor e.g.
"AsOfDate@Date@Dates", "RiskFactor@Risk Factor@Risk" * - DateInfo: its value is the string representing the date property (either current date or precious date) e.g.
"currentDate" - SensitivityName: its value is the string representing the sensi type, e.g.
"Delta", "Vega", "Gamma" * - MaxFallback days: its value is the string representing the maximum fallback days for previous date market data. By default it is set to 1 e.g.
"1"
- Specified by:
init
in interfacecom.quartetfs.biz.pivot.postprocessing.IEvaluator<com.qfs.vector.IVector>
- Specified by:
init
in interfacecom.quartetfs.biz.pivot.postprocessing.IPostProcessor<com.qfs.vector.IVector>
- Overrides:
init
in classcom.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<com.qfs.vector.IVector>
- Parameters:
properties
- The properties object.s- Throws:
com.quartetfs.fwk.QuartetException
- keyLeafLevels: It's the value representing the key levels: AsOfDate, Risk Factor e.g.
-
evaluate
public com.qfs.vector.IVector evaluate(com.quartetfs.biz.pivot.ILocation leafLocation, Object[] underlyingMeasures)
There is only one underlying measure here: the Double Sensi Value .- Specified by:
evaluate
in interfacecom.quartetfs.biz.pivot.postprocessing.IEvaluator<com.qfs.vector.IVector>
- Specified by:
evaluate
in classcom.quartetfs.biz.pivot.postprocessing.impl.ABasicPostProcessor<com.qfs.vector.IVector>
-
doEvaluate
protected abstract com.qfs.vector.IVector doEvaluate(com.quartetfs.biz.pivot.ILocation location, LocalDate asOfDate, String marketDataSet, String riskFactor, String riskClass, String sensitivityName)
-
getMarketDataRecord
protected Optional<com.qfs.store.record.IRecordReader> getMarketDataRecord(LocalDate date, String marketDataSet, String riskFactor)
Method that retrieves the market data for the current day- Parameters:
date
- as of datemarketDataSet
- market data set context valueriskFactor
- risk factor- Returns:
- market data for current day
-
stepDate
protected LocalDate stepDate(LocalDate date, boolean first)
Step the as-of date forward or backwards according todateProperty
.- Parameters:
date
- input datefirst
- is this the first time this is called in a search- Returns:
- the target date
-
convertBucketToMaturity
protected TreeMap<Double,Integer> convertBucketToMaturity(String[] buckets, BucketType bucketType, LocalDate asOfDate)
-
convertBucketToMaturity
protected TreeMap<Double,Integer> convertBucketToMaturity(Map<String,Integer> buckets, BucketType bucketType, LocalDate asOfDate)
-
setTenorUtil
public void setTenorUtil(ITenorUtil tenorUtil)
Description copied from interface:ITenorUtilAware
Set the implementation ofITenorUtil
- Specified by:
setTenorUtil
in interfaceITenorUtilAware
- Parameters:
tenorUtil
- the implementation ofITenorUtil
-
setMaturityConverter
public void setMaturityConverter(IMaturityConverter maturityConverter)
Description copied from interface:IMaturityConverterAware
Set the implementation ofIMaturityConverter
- Specified by:
setMaturityConverter
in interfaceIMaturityConverterAware
- Parameters:
maturityConverter
- the implementation ofIMaturityConverter
-
setPnLExplainFormulaProvider
public void setPnLExplainFormulaProvider(IPnLExplainFormulaProvider provider)
Description copied from interface:IPnLExplainFormulaProviderAware
Set the implementation ofIPnLExplainFormulaProvider
- Specified by:
setPnLExplainFormulaProvider
in interfaceIPnLExplainFormulaProviderAware
- Parameters:
provider
- the implementation ofIPnLExplainFormulaProvider
-
-