Class OvernightFutureTemplate

    • Method Detail

      • of

        public static OvernightFutureTemplate of​(SequenceDate sequenceDate,
                                                 OvernightFutureContractSpec 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
      • getIndex

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

        public OvernightFutureTrade 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
      • 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
      • calculateLastFixingDateFromTradeDate

        public LocalDate calculateLastFixingDateFromTradeDate​(LocalDate tradeDate,
                                                              ReferenceData refData)
        Calculates the last fixing 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<OvernightFutureTemplate> meta()
        The meta-bean for OvernightFutureTemplate.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.TypedMetaBean<OvernightFutureTemplate> 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 OvernightFutureContractSpec getContractSpec()
        Gets the underlying contract specification.

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

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

        public int hashCode()
        Overrides:
        hashCode in class Object