Class IborFutureTemplate
- java.lang.Object
-
- com.opengamma.strata.product.index.type.IborFutureTemplate
-
- All Implemented Interfaces:
TradeTemplate,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class IborFutureTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
A template for creating an Ibor Future trade.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description LocalDatecalculateReferenceDateFromTradeDate(LocalDate tradeDate, ReferenceData refData)Calculates the reference date of the trade.IborFutureTradecreateTrade(LocalDate tradeDate, SecurityId securityId, double quantity, double notional, double price, ReferenceData refData)IborFutureTradecreateTrade(LocalDate tradeDate, SecurityId securityId, double quantity, double price, ReferenceData refData)Creates a trade based on this template.booleanequals(Object obj)IborFutureContractSpecgetContractSpec()Gets the underlying contract specification.IborFutureConventiongetConvention()Deprecated.IborIndexgetIndex()Gets the underlying index.SequenceDategetSequenceDate()Gets the instructions that define which future is desired.inthashCode()static org.joda.beans.TypedMetaBean<IborFutureTemplate>meta()The meta-bean forIborFutureTemplate.org.joda.beans.TypedMetaBean<IborFutureTemplate>metaBean()static IborFutureTemplateof(SequenceDate sequenceDate, IborFutureContractSpec contractSpec)Obtains a template based on the specified contract specification and sequence date.static IborFutureTemplateof(Period minimumPeriod, int sequenceNumber, IborFutureConvention convention)Deprecated.static IborFutureTemplateof(YearMonth yearMonth, IborFutureConvention convention)Deprecated.StringtoString()
-
-
-
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 desiredcontractSpec- the contract specification- Returns:
- the template
-
of
@Deprecated public static IborFutureTemplate of(Period minimumPeriod, int sequenceNumber, IborFutureConvention convention)
Deprecated.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 futuresequenceNumber- the 1-based index of the future after the minimum period, must be 1 or greaterconvention- the future convention- Returns:
- the template
-
of
@Deprecated public static IborFutureTemplate of(YearMonth yearMonth, IborFutureConvention convention)
Deprecated.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 futureconvention- the future convention- Returns:
- the template
-
getIndex
public IborIndex getIndex()
Gets the underlying index.- Returns:
- the index
-
getConvention
@Deprecated public IborFutureConvention getConvention()
Deprecated.Gets the market convention of the Ibor future.- Returns:
- the convention
-
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 tradesecurityId- the identifier of the securityquantity- the number of contracts traded, positive if buying, negative if sellingprice- the trade pricerefData- 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 tradesecurityId- the identifier of the securityquantity- the number of contracts traded, positive if buying, negative if sellingnotional- the notional amount of one future contractprice- the trade pricerefData- 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 traderefData- 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 forIborFutureTemplate.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<IborFutureTemplate> metaBean()
- Specified by:
metaBeanin interfaceorg.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
-
-