Class BlackFxOptionSmileVolatilities

    • 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
      • volatility

        public double volatility​(CurrencyPair currencyPair,
                                 double expiryTime,
                                 double strike,
                                 double forward)
        Description copied from interface: FxOptionVolatilities
        Calculates the volatility at the specified expiry.

        This relies on expiry supplied by FxOptionVolatilities.relativeTime(ZonedDateTime).

        Specified by:
        volatility in interface FxOptionVolatilities
        Parameters:
        currencyPair - the currency pair
        expiryTime - the time to expiry as a year fraction
        strike - the option strike rate
        forward - the forward rate
        Returns:
        the volatility
      • 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
      • getSmile

        public SmileDeltaTermStructure getSmile()
        Gets the volatility model.

        This represents expiry dependent smile which consists of ATM, risk reversal and strangle as used in FX market.

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

        public int hashCode()
        Overrides:
        hashCode in class Object