Class IborFutureOptionPosition

  • All Implemented Interfaces:
    CalculationTarget, Resolvable<ResolvedIborFutureOptionTrade>, PortfolioItem, Position, SecuritizedProductPortfolioItem<IborFutureOption>, SecuritizedProductPosition<IborFutureOption>, SecurityQuantity, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class IborFutureOptionPosition
    extends Object
    implements SecuritizedProductPosition<IborFutureOption>, Resolvable<ResolvedIborFutureOptionTrade>, org.joda.beans.ImmutableBean, Serializable
    A position in an option on a futures contract based on an Ibor index.

    A position in an underlying IborFutureOption.

    An Ibor future option is also known as a STIR future option (Short Term Interest Rate).

    The net quantity of the position is stored using two fields - longQuantity and shortQuantity. These two fields must not be negative. In many cases, only a long quantity or short quantity will be present with the other set to zero. However it is also possible for both to be non-zero, allowing long and short positions to be treated separately. The net quantity is available via getQuantity().

    Price

    The price of an Ibor future option is based on the price of the underlying future, the volatility and the time to expiry. The price of the at-the-money option tends to zero as expiry approaches.

    Strata uses decimal prices for Ibor future options in the trade model, pricers and market data. The decimal price is based on the decimal rate equivalent to the percentage. For example, an option price of 0.2 is related to a futures price of 99.32 that implies an interest rate of 0.68%. Strata represents the price of the future as 0.9932 and thus represents the price of the option as 0.002.

    See Also:
    Serialized Form
    • Method Detail

      • ofNet

        public static IborFutureOptionPosition ofNet​(PositionInfo positionInfo,
                                                     IborFutureOption product,
                                                     double netQuantity)
        Obtains an instance from position information, product and net quantity.

        The net quantity is the long quantity minus the short quantity, which may be negative. If the quantity is positive it is treated as a long quantity. Otherwise it is treated as a short quantity.

        Parameters:
        positionInfo - the position information
        product - the underlying product
        netQuantity - the net quantity of the underlying security
        Returns:
        the position
      • ofLongShort

        public static IborFutureOptionPosition ofLongShort​(PositionInfo positionInfo,
                                                           IborFutureOption product,
                                                           double longQuantity,
                                                           double shortQuantity)
        Obtains an instance from position information, product, long quantity and short quantity.

        The long quantity and short quantity must be zero or positive, not negative. In many cases, only a long quantity or short quantity will be present with the other set to zero. However it is also possible for both to be non-zero, allowing long and short positions to be treated separately.

        Parameters:
        positionInfo - the position information
        product - the underlying product
        longQuantity - the long quantity of the underlying security
        shortQuantity - the short quantity of the underlying security
        Returns:
        the position
      • getQuantity

        public double getQuantity()
        Description copied from interface: Position
        Gets the net quantity of the security.

        This returns the net quantity of the underlying security. The result is positive if the net position is long and negative if the net position is short.

        Specified by:
        getQuantity in interface Position
        Specified by:
        getQuantity in interface SecurityQuantity
        Returns:
        the net quantity of the underlying security
      • resolve

        public ResolvedIborFutureOptionTrade resolve​(ReferenceData refData)
        Description copied from interface: Resolvable
        Resolves this object using the specified reference data.

        This converts the object implementing this interface to the equivalent resolved form. All ReferenceDataId identifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.

        Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.

        Specified by:
        resolve in interface Resolvable<ResolvedIborFutureOptionTrade>
        Parameters:
        refData - the reference data to use when resolving
        Returns:
        the resolved instance
      • getInfo

        public PositionInfo getInfo()
        Gets the additional position information, defaulted to an empty instance.

        This allows additional information to be attached to the position.

        Specified by:
        getInfo in interface PortfolioItem
        Specified by:
        getInfo in interface Position
        Returns:
        the value of the property, not null
      • getLongQuantity

        public double getLongQuantity()
        Gets the long quantity of the security.

        This is the quantity of the underlying security that is held. The quantity cannot be negative, as that would imply short selling.

        Returns:
        the value of the property
      • getShortQuantity

        public double getShortQuantity()
        Gets the short quantity of the security.

        This is the quantity of the underlying security that has been short sold. The quantity cannot be negative, as that would imply the position is long.

        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object