Interface Security

    • Method Detail

      • getInfo

        SecurityInfo getInfo()
        Gets the standard security information.

        All securities contain this standard set of information. It includes the identifier, information about the price and an extensible data map.

        Returns:
        the security information
      • getSecurityId

        default SecurityId getSecurityId()
        Gets the security identifier.

        This identifier uniquely identifies the security within the system.

        Returns:
        the security identifier
      • getCurrency

        default Currency getCurrency()
        Gets the currency that the security is traded in.
        Returns:
        the trading currency
      • getUnderlyingIds

        com.google.common.collect.ImmutableSet<SecurityId> getUnderlyingIds()
        Gets the set of underlying security identifiers.

        The set must contain all the security identifiers that this security directly refers to. For example, a bond future will return the identifiers of the underlying basket of bonds, but a bond future option will only return the identifier of the underlying future, not the basket.

        Returns:
        the underlying security identifiers
      • withInfo

        Security withInfo​(SecurityInfo info)
        Returns an instance with the specified info.
        Parameters:
        info - the new info
        Returns:
        the instance with the specified info
      • createProduct

        SecuritizedProduct createProduct​(ReferenceData refData)
        Creates the product associated with this security.

        The product of a security is distinct from the security. The product includes the financial details from this security, but excludes the additional information. The product also includes the products of any underlying securities.

        Parameters:
        refData - the reference data used to find underlying securities
        Returns:
        the product
        Throws:
        java.lang.UnsupportedOperationException - if the security does not contain information about the product model
      • createTrade

        SecurityQuantityTrade createTrade​(TradeInfo tradeInfo,
                                          double quantity,
                                          double tradePrice,
                                          ReferenceData refData)
        Creates a trade based on this security.

        This creates a trade of a suitable type for this security.

        Parameters:
        tradeInfo - the trade information
        quantity - the number of contracts in the trade
        tradePrice - the price agreed when the trade occurred
        refData - the reference data used to find underlying securities
        Returns:
        the trade
      • createPosition

        Position createPosition​(PositionInfo positionInfo,
                                double quantity,
                                ReferenceData refData)
        Creates a position based on this security from a net quantity.

        This creates a position of a suitable type for this security.

        Parameters:
        positionInfo - the position information
        quantity - the number of contracts in the position
        refData - the reference data used to find underlying securities
        Returns:
        the position
      • createPosition

        Position createPosition​(PositionInfo positionInfo,
                                double longQuantity,
                                double shortQuantity,
                                ReferenceData refData)
        Creates a position based on this security from a long and short quantity.

        This creates a position of a suitable type for this security.

        The long quantity and short quantity must be zero or positive, not negative.

        Parameters:
        positionInfo - the position information
        longQuantity - the long quantity in the position
        shortQuantity - the short quantity in the position
        refData - the reference data used to find underlying securities
        Returns:
        the position