Class IborFutureTemplate

    • Method Detail

      • of

        public static IborFutureTemplate of​(SequenceDate sequenceDate,
                                            IborFutureContractSpec contractSpec)
        Obtains a template based on the specified contract specification and sequence date.

        The specific future is defined by two date-related inputs - the sequence date and the date sequence embedded in the contract specification.

        Parameters:
        sequenceDate - the instructions that define which future is desired
        contractSpec - the contract specification
        Returns:
        the template
      • of

        @Deprecated
        public static IborFutureTemplate of​(Period minimumPeriod,
                                            int sequenceNumber,
                                            IborFutureConvention convention)
        Obtains a template based on the specified convention using a relative definition of time.

        The specific future is defined by two date-related inputs, the minimum period and the 1-based future number. For example, the 2nd future of the series where the 1st future is at least 1 week after the value date would be represented by a minimum period of 1 week and future number 2.

        Parameters:
        minimumPeriod - the minimum period between the base date and the first future
        sequenceNumber - the 1-based index of the future after the minimum period, must be 1 or greater
        convention - the future convention
        Returns:
        the template
      • of

        @Deprecated
        public static IborFutureTemplate of​(YearMonth yearMonth,
                                            IborFutureConvention convention)
        Obtains a template based on the specified convention using an absolute definition of time.

        The future is selected from a sequence of futures based on a year-month. In most cases, the date of the future will be in the same month as the specified month, but this is not guaranteed.

        Parameters:
        yearMonth - the year-month to use to select the future
        convention - the future convention
        Returns:
        the template
      • getIndex

        public IborIndex getIndex()
        Gets the underlying index.
        Returns:
        the index
      • createTrade

        public IborFutureTrade createTrade​(LocalDate tradeDate,
                                           SecurityId securityId,
                                           double quantity,
                                           double price,
                                           ReferenceData refData)
        Creates a trade based on this template.

        This returns a trade based on the specified date.

        Parameters:
        tradeDate - the date of the trade
        securityId - the identifier of the security
        quantity - the number of contracts traded, positive if buying, negative if selling
        price - the trade price
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
        Throws:
        ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
      • createTrade

        @Deprecated
        public IborFutureTrade createTrade​(LocalDate tradeDate,
                                           SecurityId securityId,
                                           double quantity,
                                           double notional,
                                           double price,
                                           ReferenceData refData)
        Creates a trade based on this template.

        This returns a trade based on the specified date. The notional is unsigned, with the quantity determining the direction of the trade.

        Parameters:
        tradeDate - the date of the trade
        securityId - the identifier of the security
        quantity - the number of contracts traded, positive if buying, negative if selling
        notional - the notional amount of one future contract
        price - the trade price
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
        Throws:
        ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
      • calculateReferenceDateFromTradeDate

        public LocalDate calculateReferenceDateFromTradeDate​(LocalDate tradeDate,
                                                             ReferenceData refData)
        Calculates the reference date of the trade.
        Parameters:
        tradeDate - the date of the trade
        refData - the reference data, used to resolve the date
        Returns:
        the future reference date
      • meta

        public static org.joda.beans.TypedMetaBean<IborFutureTemplate> meta()
        The meta-bean for IborFutureTemplate.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.TypedMetaBean<IborFutureTemplate> metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getSequenceDate

        public SequenceDate getSequenceDate()
        Gets the instructions that define which future is desired.
        Returns:
        the value of the property, not null
      • getContractSpec

        public IborFutureContractSpec getContractSpec()
        Gets the underlying contract specification.

        This specifies the contract of the Ibor Futures to be created.

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

        public int hashCode()
        Overrides:
        hashCode in class Object