Interface Position

    • Method Detail

      • summarize

        default PortfolioItemSummary summarize()
        Description copied from interface: PortfolioItem
        Summarizes the portfolio item.

        This provides a summary, including a human readable description.

        Specified by:
        summarize in interface PortfolioItem
        Returns:
        the summary of the item
      • getInfo

        PositionInfo getInfo()
        Gets the standard position information.

        All positions contain this standard set of information. It includes the identifier and an extensible data map.

        Specified by:
        getInfo in interface PortfolioItem
        Returns:
        the position information
      • getSecurityId

        SecurityId getSecurityId()
        Gets the identifier of the underlying security.

        This identifier uniquely identifies the security within the system.

        Specified by:
        getSecurityId in interface SecurityQuantity
        Returns:
        the security identifier
      • getQuantity

        double getQuantity()
        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 SecurityQuantity
        Returns:
        the net quantity of the underlying security
      • withInfo

        Position withInfo​(PortfolioItemInfo info)
        Returns an instance with the specified info.
        Specified by:
        withInfo in interface PortfolioItem
        Parameters:
        info - the new info
        Returns:
        the instance with the specified info
      • withQuantity

        Position withQuantity​(double quantity)
        Returns an instance with the specified quantity.
        Parameters:
        quantity - the new quantity
        Returns:
        the instance with the specified quantity