Class ScalarMarketDataRetrievalService

    • Method Detail

      • getRawMarketData

        protected IMarketDataset<double[],​Double> getRawMarketData​(IServiceContext context,
                                                                         LocalDate date,
                                                                         String marketDataSet,
                                                                         String sensitivityKind,
                                                                         String sensitivityName,
                                                                         String riskClass,
                                                                         String riskFactor,
                                                                         int nrDim)
        Description copied from class: AMarketDataRetrievalService
        This function retrieves the data before any manipulation
        Specified by:
        getRawMarketData in class AMarketDataRetrievalService
        Parameters:
        context - The caller context
        date - The requested date
        marketDataSet - The requested dataset
        sensitivityKind - The type of sensitivity delta / gamma /vega / ....
        sensitivityName - Th underlying name
        riskClass - the risk class
        riskFactor - The requested name
        nrDim - The number of dimension of the result
        Returns:
        A list of MD and its axis description
      • getRawPnlVector

        protected IMarketDataset<com.qfs.vector.IVector[],​com.qfs.vector.IVector> getRawPnlVector​(IServiceContext context,
                                                                                                        LocalDate date,
                                                                                                        String scenario,
                                                                                                        String marketDataSet,
                                                                                                        String sensitivityKind,
                                                                                                        String sensitivityName,
                                                                                                        String riskClass,
                                                                                                        String riskFactor,
                                                                                                        int nrDim)
        Description copied from class: AMarketDataRetrievalService
        This function retrieves the data before any manipulation
        Specified by:
        getRawPnlVector in class AMarketDataRetrievalService
        Parameters:
        context - The caller context
        date - The requested date
        scenario - The requested dataset
        marketDataSet - The requested market data set
        sensitivityKind - The type of sensitivity delta / gamma /vega / ....
        sensitivityName - The underlying
        riskClass - The risk class
        riskFactor - The requested name
        nrDim - The number of dimension of the result
        Returns:
        A list of pnl vector and its axis description
      • getNominal

        protected Double getNominal​(IServiceContext context,
                                    LocalDate date,
                                    String marketDataSet,
                                    String sensitivityKind,
                                    String sensitivityName,
                                    String riskClass,
                                    String riskFactor)
        Description copied from class: AMarketDataRetrievalService
        Retrieve the nominal of a risk factor
        Specified by:
        getNominal in class AMarketDataRetrievalService
        Parameters:
        context - The caller context
        date - The requested date
        marketDataSet - The requested dataset
        sensitivityKind - The type of sensitivity delta / gamma /vega / ....
        sensitivityName - The underlying
        riskClass - The risk class
        riskFactor - The requested name
        Returns:
        The value of the Nominal
      • getMarketData

        public double[] getMarketData​(IServiceContext context,
                                      LocalDate date,
                                      String marketDataSet,
                                      String sensitivityKind,
                                      String sensitivityName,
                                      String riskClass,
                                      String riskFactor,
                                      IMarketDataRetrievalService.IPillarSet[] requestedPillars,
                                      boolean interpolate,
                                      IMarketDataRetrievalService.MarketType type,
                                      String debugKey)
        This function is overridden in order to add an optimisation in case of single non interpolated data retrieval
        Specified by:
        getMarketData in interface IMarketDataRetrievalService
        Overrides:
        getMarketData in class AMarketDataRetrievalService
        Parameters:
        context - The caller context
        date - The as of date of the market data
        marketDataSet - The set of data to look for
        sensitivityKind - the type of sensitivity delta / gamma /vega / ....
        sensitivityName - The kind of sensi
        riskClass - The risk class of the requested market data
        riskFactor - The name of the market data
        requestedPillars - The list of the requested pillar. For instance IPillarSets[0] for tenor, IPillarSets[1] for maturity, IPillarSets[2] for moneyness
        interpolate - Is the interpolation allowed
        type - The type of the returned market data : absolute means the market price in currency (for bonds price x nominal), relative to the nominal, raw aka as it is normally used / store
        debugKey - If not null will store debug info in the cache at the ket location
        Returns:
        A list of values describing a vector / map / cube depending of the requested dimensions, coordinates are (i * size(j) + j) * size(k) + k
      • isSingleValue

        public boolean isSingleValue​(IMarketDataRetrievalService.IPillarSet[] requestedPillars)
        Return the number of elements corresponding to the requested pillars
        Returns:
        The size of the vector / map / cube / ...
      • getMarketDataRecord

        protected com.qfs.store.record.IRecordReader getMarketDataRecord​(IServiceContext context,
                                                                         LocalDate date,
                                                                         String marketDataSet,
                                                                         String riskFactor,
                                                                         IMarketDataRetrievalService.IPillarSet[] requestedPillars)
        Method that retrieves the market data for the current day
        Parameters:
        context - The caller context
        date - as of date
        marketDataSet - market data set context value
        riskFactor - risk factor
        requestedPillars - The list of the requested pillar. For instance IPillarSets[0] for tenor, IPillarSets[1] for maturity, IPillarSets[2] for moneyness
        Returns:
        market data for current day and tenor/maturity
      • fetchMarketData

        protected com.qfs.store.record.IRecordReader fetchMarketData​(IServiceContext context,
                                                                     LocalDate date,
                                                                     String marketDataSet,
                                                                     String riskFactor,
                                                                     IntFunction<Object> labels,
                                                                     IntFunction<Object> dates)
        Attempts to fetch a market data record by its key.
        Parameters:
        context - The caller context
        date - The as of date.
        marketDataSet - The market data set.
        riskFactor - The risk factor.
        labels - The array of label values.
        dates - The array of date values.
        Returns:
        An optional containing a market data record, if found.