Class BlackFxOptionFlatVolatilities

    • Method Detail

      • findData

        public <T> Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: MarketDataView
        Finds the market data with the specified name.

        This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.

        Specified by:
        findData in interface MarketDataView
        Type Parameters:
        T - the type of the market data value
        Parameters:
        name - the name to find
        Returns:
        the market data value, empty if not found
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: ParameterizedData
        Gets the number of parameters.

        This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.

        Specified by:
        getParameterCount in interface ParameterizedData
        Returns:
        the number of parameters
      • getParameter

        public double getParameter​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the value of the parameter at the specified index.
        Specified by:
        getParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the value of the parameter
      • getParameterMetadata

        public ParameterMetadata getParameterMetadata​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Specified by:
        getParameterMetadata in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
      • findParameterIndex

        public OptionalInt findParameterIndex​(ParameterMetadata metadata)
        Description copied from interface: ParameterizedData
        Finds the parameter index of the specified metadata.

        If the parameter metadata is not matched, an empty optional will be returned.

        Specified by:
        findParameterIndex in interface ParameterizedData
        Parameters:
        metadata - the parameter metadata to find the index of
        Returns:
        the index of the parameter
      • firstPartialDerivatives

        public ValueDerivatives firstPartialDerivatives​(CurrencyPair currencyPair,
                                                        double expiry,
                                                        double strike,
                                                        double forward)
        Description copied from interface: FxOptionVolatilities
        Computes the partial derivatives of the volatilities.

        The first derivatives are dVol/dExpiry and dVol/dStrike. The derivatives are in the following order:

        • [0] derivative with respect to expiry
        • [1] derivative with respect to strike
        Specified by:
        firstPartialDerivatives in interface FxOptionVolatilities
        Parameters:
        currencyPair - the currency pair
        expiry - the expiry at which the partial derivative is taken
        strike - the strike at which the partial derivative is taken
        forward - the forward rate
        Returns:
        the z-value and it's partial first derivatives
      • relativeTime

        public double relativeTime​(ZonedDateTime dateTime)
        Description copied from interface: FxOptionVolatilities
        Converts a time and date to a relative year fraction.

        When the date is after the valuation date (and potentially time), the returned number is negative.

        Specified by:
        relativeTime in interface FxOptionVolatilities
        Parameters:
        dateTime - the date-time to find the relative year fraction of
        Returns:
        the relative year fraction
      • getValuationDateTime

        public ZonedDateTime getValuationDateTime()
        Gets the valuation date-time. All data items in this provider is calibrated for this date-time.
        Specified by:
        getValuationDateTime in interface FxOptionVolatilities
        Returns:
        the value of the property, not null
      • getCurve

        public Curve getCurve()
        Gets the Black volatility curve.

        The x-values represent the expiry year-fraction. The metadata of the curve must define a day count.

        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object