Class ImmutableOvernightFutureContractSpec
- java.lang.Object
-
- com.opengamma.strata.product.index.type.ImmutableOvernightFutureContractSpec
-
- All Implemented Interfaces:
Named,OvernightFutureContractSpec,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ImmutableOvernightFutureContractSpec extends Object implements OvernightFutureContractSpec, org.joda.beans.ImmutableBean, Serializable
A contract specification for exchange traded Overnight Futures.The contract specification defines how the future is traded. A specific future is created by specifying the year-month.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOvernightFutureContractSpec.BuilderThe bean-builder forImmutableOvernightFutureContractSpec.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOvernightFutureContractSpec.Builderbuilder()Returns a builder used to create an instance of the bean.LocalDatecalculateLastFixingDate(LocalDate referenceDate, ReferenceData refData)Calculates the last fixing date from the trade date.LocalDatecalculateReferenceDate(LocalDate tradeDate, SequenceDate sequenceDate, ReferenceData refData)Calculates the reference date from the trade date.OvernightFuturePositioncreatePosition(SecurityId securityId, YearMonth expiry, double quantity, ReferenceData refData)Creates a position based on this convention.OvernightFutureTradecreateTrade(LocalDate tradeDate, SecurityId securityId, SequenceDate sequenceDate, double quantity, double price, ReferenceData refData)Creates a trade based on this convention.booleanequals(Object obj)OvernightAccrualMethodgetAccrualMethod()Gets the method of accruing Overnight interest.DateSequencegetDateSequence()Gets the sequence of dates that the future is based on.DaysAdjustmentgetEndDateAdjustment()Gets the days adjustment to apply to get the end date.OvernightIndexgetIndex()Gets the Overnight index.DaysAdjustmentgetLastTradeDateAdjustment()Gets the days adjustment to apply to get the last trade date.StringgetName()Gets the name, such as 'GBP-SONIA-3M-IMM-ICE'.doublegetNotional()Gets the notional deposit that the contract models.BusinessDayAdjustmentgetStartDateAdjustment()Gets the business day adjustment to apply to get the start date.inthashCode()static org.joda.beans.TypedMetaBean<ImmutableOvernightFutureContractSpec>meta()The meta-bean forImmutableOvernightFutureContractSpec.org.joda.beans.TypedMetaBean<ImmutableOvernightFutureContractSpec>metaBean()ImmutableOvernightFutureContractSpec.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()
-
-
-
Method Detail
-
createTrade
public OvernightFutureTrade createTrade(LocalDate tradeDate, SecurityId securityId, SequenceDate sequenceDate, double quantity, double price, ReferenceData refData)
Description copied from interface:OvernightFutureContractSpecCreates a trade based on this convention.This returns a trade based on the instructions in the
SequenceDate. The sequence date points at the expiry of the future, which is how they are referred to in the market.- Specified by:
createTradein interfaceOvernightFutureContractSpec- Parameters:
tradeDate- the trade datesecurityId- the identifier of the securitysequenceDate- the date to be used from the sequence identifying the expiry of the futurequantity- the number of contracts traded, positive if buying, negative if sellingprice- the trade price of the futurerefData- the reference data, used to resolve the trade dates- Returns:
- the trade
-
createPosition
public OvernightFuturePosition createPosition(SecurityId securityId, YearMonth expiry, double quantity, ReferenceData refData)
Description copied from interface:OvernightFutureContractSpecCreates a position based on this convention.- Specified by:
createPositionin interfaceOvernightFutureContractSpec- Parameters:
securityId- the identifier of the securityexpiry- the expiry year monthquantity- the number of contracts traded, positive if buying, negative if sellingrefData- the reference data, used to resolve the trade dates- Returns:
- the position
-
calculateReferenceDate
public LocalDate calculateReferenceDate(LocalDate tradeDate, SequenceDate sequenceDate, ReferenceData refData)
Description copied from interface:OvernightFutureContractSpecCalculates the reference date from the trade date.This determines the date from the
SequenceDate.- Specified by:
calculateReferenceDatein interfaceOvernightFutureContractSpec- Parameters:
tradeDate- the trade datesequenceDate- the date to be used from the sequencerefData- the reference data, used to resolve the date- Returns:
- the reference date of the contract, also known as the start date
-
calculateLastFixingDate
public LocalDate calculateLastFixingDate(LocalDate referenceDate, ReferenceData refData)
Description copied from interface:OvernightFutureContractSpecCalculates the last fixing date from the trade date.- Specified by:
calculateLastFixingDatein interfaceOvernightFutureContractSpec- Parameters:
referenceDate- the reference date of the contract, also known as the start daterefData- the reference data, used to resolve the date- Returns:
- the last fixing date
-
meta
public static org.joda.beans.TypedMetaBean<ImmutableOvernightFutureContractSpec> meta()
The meta-bean forImmutableOvernightFutureContractSpec.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableOvernightFutureContractSpec.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public org.joda.beans.TypedMetaBean<ImmutableOvernightFutureContractSpec> metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public String getName()
Gets the name, such as 'GBP-SONIA-3M-IMM-ICE'.- Specified by:
getNamein interfaceNamed- Specified by:
getNamein interfaceOvernightFutureContractSpec- Returns:
- the value of the property, not blank
-
getIndex
public OvernightIndex getIndex()
Gets the Overnight index.The floating rate to be paid is based on this index It will be a well known market index such as 'GBP-SONIA'.
- Specified by:
getIndexin interfaceOvernightFutureContractSpec- Returns:
- the value of the property, not null
-
getDateSequence
public DateSequence getDateSequence()
Gets the sequence of dates that the future is based on.This is used to calculate the reference date of the future that is the start date of the underlying synthetic deposit.
- Returns:
- the value of the property, not null
-
getAccrualMethod
public OvernightAccrualMethod getAccrualMethod()
Gets the method of accruing Overnight interest.- Returns:
- the value of the property, not null
-
getStartDateAdjustment
public BusinessDayAdjustment getStartDateAdjustment()
Gets the business day adjustment to apply to get the start date.The start date is obtained by applying this adjustment to the reference date from the date sequence. The reference date is often the third Wednesday of the month or the start of the month. This defaults to accepting the date from the sequence without applying a holiday calendar.
- Returns:
- the value of the property, not null
-
getEndDateAdjustment
public DaysAdjustment getEndDateAdjustment()
Gets the days adjustment to apply to get the end date.The end date is obtained by applying this adjustment to the next date in sequence from the start date. This defaults to minus one without applying a holiday calendar.
- Returns:
- the value of the property
-
getLastTradeDateAdjustment
public DaysAdjustment getLastTradeDateAdjustment()
Gets the days adjustment to apply to get the last trade date.The last trade date is obtained by applying this adjustment to the next date in sequence from the start date. This defaults to the previous business day in the fixing calendar (minus one calendar day and preceding).
- Returns:
- the value of the property, not null
-
getNotional
public double getNotional()
Gets the notional deposit that the contract models.This is the full notional of the deposit, such as 1 million dollars. The notional expressed here must be positive. The currency of the notional is specified by the index.
- Specified by:
getNotionalin interfaceOvernightFutureContractSpec- Returns:
- the value of the property
-
toBuilder
public ImmutableOvernightFutureContractSpec.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-