Class OvernightFutureSecurity
- java.lang.Object
-
- com.opengamma.strata.product.index.OvernightFutureSecurity
-
- All Implemented Interfaces:
RateIndexSecurity,Security,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class OvernightFutureSecurity extends Object implements RateIndexSecurity, org.joda.beans.ImmutableBean, Serializable
A security representing a futures contract based on an Overnight rate index.An Overnight rate future is a financial instrument that is based on the future value of an Overnight index interest rate. The profit or loss of an Overnight rate future is settled daily. This class represents the structure of a single futures contract.
For example, the widely traded "30-Day Federal Funds futures contract" has a notional of 5 million USD, is based on the US Federal Funds Effective Rate 'USD-FED-FUND', expiring the last business day of each month.
Price
The price of an Overnight rate future is based on the interest rate of the underlying index. It is defined as(100 - percentRate).Strata uses decimal prices for Overnight rate futures in the trade model, pricers and market data. The decimal price is based on the decimal rate equivalent to the percentage. For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOvernightFutureSecurity.BuilderThe bean-builder forOvernightFutureSecurity.static classOvernightFutureSecurity.MetaThe meta-bean forOvernightFutureSecurity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OvernightFutureSecurity.Builderbuilder()Returns a builder used to create an instance of the bean.OvernightFuturePositioncreatePosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)Creates a position based on this security from a long and short quantity.OvernightFuturePositioncreatePosition(PositionInfo positionInfo, double quantity, ReferenceData refData)Creates a position based on this security from a net quantity.OvernightFuturecreateProduct(ReferenceData refData)Creates the product associated with this security.OvernightFutureTradecreateTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)Creates a trade based on this security.booleanequals(Object obj)doublegetAccrualFactor()Gets the accrual factor, defaulted from the index if not set.OvernightAccrualMethodgetAccrualMethod()Gets the method of accruing Overnight interest.CurrencygetCurrency()Gets the currency that the security is traded in.LocalDategetEndDate()Gets the last date of the rate calculation period.OvernightIndexgetIndex()Gets the underlying Overnight index.SecurityInfogetInfo()Gets the standard security information.LocalDategetLastTradeDate()Gets the last date of trading.doublegetNotional()Gets the notional amount.RoundinggetRounding()Gets the definition of how to round the futures price, defaulted to no rounding.LocalDategetStartDate()Gets the first date of the rate calculation period.ImmutableSet<SecurityId>getUnderlyingIds()Gets the set of underlying security identifiers.inthashCode()static OvernightFutureSecurity.Metameta()The meta-bean forOvernightFutureSecurity.OvernightFutureSecurity.MetametaBean()OvernightFutureSecurity.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()OvernightFutureSecuritywithInfo(SecurityInfo info)Returns an instance with the specified info.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Security
getSecurityId
-
-
-
-
Method Detail
-
getCurrency
public Currency getCurrency()
Description copied from interface:SecurityGets the currency that the security is traded in.- Specified by:
getCurrencyin interfaceSecurity- Returns:
- the trading currency
-
getUnderlyingIds
public ImmutableSet<SecurityId> getUnderlyingIds()
Description copied from interface:SecurityGets the set of underlying security identifiers.The set must contain all the security identifiers that this security directly refers to. For example, a bond future will return the identifiers of the underlying basket of bonds, but a bond future option will only return the identifier of the underlying future, not the basket.
- Specified by:
getUnderlyingIdsin interfaceSecurity- Returns:
- the underlying security identifiers
-
withInfo
public OvernightFutureSecurity withInfo(SecurityInfo info)
Description copied from interface:SecurityReturns an instance with the specified info.- Specified by:
withInfoin interfaceRateIndexSecurity- Specified by:
withInfoin interfaceSecurity- Parameters:
info- the new info- Returns:
- the instance with the specified info
-
createProduct
public OvernightFuture createProduct(ReferenceData refData)
Description copied from interface:SecurityCreates the product associated with this security.The product of a security is distinct from the security. The product includes the financial details from this security, but excludes the additional information. The product also includes the products of any underlying securities.
- Specified by:
createProductin interfaceSecurity- Parameters:
refData- the reference data used to find underlying securities- Returns:
- the product
-
createTrade
public OvernightFutureTrade createTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)
Description copied from interface:SecurityCreates a trade based on this security.This creates a trade of a suitable type for this security.
- Specified by:
createTradein interfaceSecurity- Parameters:
info- the trade informationquantity- the number of contracts in the tradetradePrice- the price agreed when the trade occurredrefData- the reference data used to find underlying securities- Returns:
- the trade
-
createPosition
public OvernightFuturePosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
Description copied from interface:SecurityCreates a position based on this security from a net quantity.This creates a position of a suitable type for this security.
- Specified by:
createPositionin interfaceSecurity- Parameters:
positionInfo- the position informationquantity- the number of contracts in the positionrefData- the reference data used to find underlying securities- Returns:
- the position
-
createPosition
public OvernightFuturePosition createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
Description copied from interface:SecurityCreates a position based on this security from a long and short quantity.This creates a position of a suitable type for this security.
The long quantity and short quantity must be zero or positive, not negative.
- Specified by:
createPositionin interfaceSecurity- Parameters:
positionInfo- the position informationlongQuantity- the long quantity in the positionshortQuantity- the short quantity in the positionrefData- the reference data used to find underlying securities- Returns:
- the position
-
meta
public static OvernightFutureSecurity.Meta meta()
The meta-bean forOvernightFutureSecurity.- Returns:
- the meta-bean, not null
-
builder
public static OvernightFutureSecurity.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public OvernightFutureSecurity.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getInfo
public SecurityInfo getInfo()
Gets the standard security information.This includes the security identifier.
-
getNotional
public double getNotional()
Gets the notional amount.This is the full notional of the deposit, such as 5 million dollars. The notional expressed here must be positive. The currency of the notional the same as the currency of the index.
- Returns:
- the value of the property
-
getAccrualFactor
public double getAccrualFactor()
Gets the accrual factor, defaulted from the index if not set.This is the year fraction of the contract, typically 1/12 for a 30-day future. As such, it is often unrelated to the day count of the index. The year fraction must be positive.
- Returns:
- the value of the property
-
getLastTradeDate
public LocalDate getLastTradeDate()
Gets the last date of trading.This must be a valid business day on the fixing calendar of
index. For example, the last trade date is often the last business day of the month.- Returns:
- the value of the property, not null
-
getStartDate
public LocalDate getStartDate()
Gets the first date of the rate calculation period.This is not necessarily a valid business day on the fixing calendar of
index. However, it will be adjusted inOvernightRateComputationif needed.- Returns:
- the value of the property, not null
-
getEndDate
public LocalDate getEndDate()
Gets the last date of the rate calculation period.This is not necessarily a valid business day on the fixing calendar of
index. However, it will be adjusted inOvernightRateComputationif needed.- Returns:
- the value of the property, not null
-
getIndex
public OvernightIndex getIndex()
Gets the underlying Overnight index.The future is based on this index. It will be a well known market index such as 'USD-FED-FUND'.
- Specified by:
getIndexin interfaceRateIndexSecurity- Returns:
- the value of the property, not null
-
getAccrualMethod
public OvernightAccrualMethod getAccrualMethod()
Gets the method of accruing Overnight interest.The average rate is calculated based on this method over the period between
startDateandendDate.- Returns:
- the value of the property, not null
-
getRounding
public Rounding getRounding()
Gets the definition of how to round the futures price, defaulted to no rounding.The price is represented in decimal form, not percentage form. As such, the decimal places expressed by the rounding refers to this decimal form. For example, the common market price of 99.7125 for a 0.2875% rate is represented as 0.997125 which has 6 decimal places.
- Returns:
- the value of the property, not null
-
toBuilder
public OvernightFutureSecurity.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-