Interface IborFutureTemplate

  • All Superinterfaces:
    TradeTemplate

    public interface IborFutureTemplate
    extends TradeTemplate
    A template for creating an Ibor Future trade.
    • Method Detail

      • of

        static IborFutureTemplate of​(java.time.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

        static IborFutureTemplate of​(java.time.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

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

        IborFutureConvention getConvention()
        Gets the market convention of the Ibor future.
        Returns:
        the convention
      • createTrade

        IborFutureTrade createTrade​(java.time.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

        java.time.LocalDate calculateReferenceDateFromTradeDate​(java.time.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
      • approximateMaturity

        double approximateMaturity​(java.time.LocalDate tradeDate)
        Calculates the approximate maturity from the trade date.

        This returns a year fraction that estimates the time to maturity. For example, this might take the number of months between the trade date and the date of the end of the future and divide it by 12.

        Parameters:
        tradeDate - the trade date
        Returns:
        the approximate time to maturity