Class FxOptionVolatilitiesNode

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class FxOptionVolatilitiesNode
    extends Object
    implements org.joda.beans.ImmutableBean, Serializable
    A node in the configuration specifying how to build FX option volatilities.

    Each node is not necessarily associated with an instrument, but provides the necessary information to create FxOptionVolatilities.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static FxOptionVolatilitiesNode of​(CurrencyPair currencyPair,
                                                  DaysAdjustment spotDateOffset,
                                                  BusinessDayAdjustment businessDayAdjustment,
                                                  ValueType quoteValueType,
                                                  QuoteId quoteId,
                                                  Tenor tenor,
                                                  Strike strike)
        Creates an instance.

        The label is created from quoteId.

        Parameters:
        currencyPair - the currency pair
        spotDateOffset - the spot date offset
        businessDayAdjustment - the business day adjustment
        quoteValueType - the quote value type
        quoteId - the quote ID
        tenor - the tenor
        strike - the strike
        Returns:
        the instance
      • timeToExpiry

        public double timeToExpiry​(ZonedDateTime valuationDateTime,
                                   DayCount dayCount,
                                   ReferenceData refData)
        Calculates the time to expiry for the valuation date time.
        Parameters:
        valuationDateTime - the valuation date time
        dayCount - the day count
        refData - the reference data
        Returns:
        the time to expiry
      • getCurrencyPair

        public CurrencyPair getCurrencyPair()
        Gets the currency pair.

        The quote must be based on this currency pair and direction.

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

        public String getLabel()
        Gets the label to use for the node.
        Returns:
        the value of the property, not null
      • getSpotDateOffset

        public DaysAdjustment getSpotDateOffset()
        Gets the offset of the spot value date from the valuation date.

        Typically this is the same as the standard convention of the spot date offset of the underlying FX forward.

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

        public BusinessDayAdjustment getBusinessDayAdjustment()
        Gets the business day adjustment to apply to the delivery date.

        Typically this is the same as the standard convention of the business day adjustment applied to the delivery date of the underlying FX forward.

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

        public DaysAdjustment getExpiryDateOffset()
        Gets the offset of the expiry date from the delivery date.

        By default the expiry date offset is the inverse of spotDateOffset. In this case BusinessDayAdjustment in spotDateOffset must be NONE.

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

        public ValueType getQuoteValueType()
        Gets the value type of the quote.
        Returns:
        the value of the property, not null
      • getQuoteId

        public QuoteId getQuoteId()
        Gets the quote ID.
        Returns:
        the value of the property, not null
      • getTenor

        public Tenor getTenor()
        Gets the tenor.

        Typically the tenor is coherent to that of the underlying FX forward. Thus it spans the period between spot date to delivery date.

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

        public Strike getStrike()
        Gets the strike.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object