Class OvernightFuturePosition
- java.lang.Object
-
- com.opengamma.strata.product.index.OvernightFuturePosition
-
- All Implemented Interfaces:
CalculationTarget,Resolvable<ResolvedOvernightFutureTrade>,PortfolioItem,Position,SecuritizedProductPortfolioItem<OvernightFuture>,SecuritizedProductPosition<OvernightFuture>,SecurityQuantity,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class OvernightFuturePosition extends Object implements SecuritizedProductPosition<OvernightFuture>, Resolvable<ResolvedOvernightFutureTrade>, org.joda.beans.ImmutableBean, Serializable
A futures contract based on an Overnight index.An Overnight rate future is a financial instrument that is based on the future value of an Overnight rate index interest rate. The profit or loss of an Overnight rate future is settled daily.
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 classOvernightFuturePosition.BuilderThe bean-builder forOvernightFuturePosition.static classOvernightFuturePosition.MetaThe meta-bean forOvernightFuturePosition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OvernightFuturePosition.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)CurrencygetCurrency()Gets the currency of the position.PositionInfogetInfo()Gets the additional position information, defaulted to an empty instance.doublegetLongQuantity()Gets the long quantity of the security.OvernightFuturegetProduct()Gets the future that was traded.doublegetQuantity()Gets the net quantity of the security.SecurityIdgetSecurityId()Gets the identifier of the underlying security.doublegetShortQuantity()Gets the short quantity of the security.inthashCode()static OvernightFuturePosition.Metameta()The meta-bean forOvernightFuturePosition.OvernightFuturePosition.MetametaBean()static OvernightFuturePositionofLongShort(PositionInfo positionInfo, OvernightFuture product, double longQuantity, double shortQuantity)Obtains an instance from position information, product, long quantity and short quantity.static OvernightFuturePositionofNet(PositionInfo positionInfo, OvernightFuture product, double netQuantity)Obtains an instance from position information, product and net quantity.ResolvedOvernightFutureTraderesolve(ReferenceData refData)Resolves this object using the specified reference data.PortfolioItemSummarysummarize()Summarizes the portfolio item.OvernightFuturePosition.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()OvernightFuturePositionwithInfo(PortfolioItemInfo info)Returns an instance with the specified info.OvernightFuturePositionwithQuantity(double quantity)Returns an instance with the specified quantity.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.PortfolioItem
getId
-
-
-
-
Method Detail
-
ofNet
public static OvernightFuturePosition ofNet(PositionInfo positionInfo, OvernightFuture product, double netQuantity)
Obtains an instance from position information, product and net quantity.The net quantity is the long quantity minus the short quantity, which may be negative. If the quantity is positive it is treated as a long quantity. Otherwise it is treated as a short quantity.
- Parameters:
positionInfo- the position informationproduct- the underlying productnetQuantity- the net quantity of the underlying security- Returns:
- the position
-
ofLongShort
public static OvernightFuturePosition ofLongShort(PositionInfo positionInfo, OvernightFuture product, double longQuantity, double shortQuantity)
Obtains an instance from position information, product, long quantity and short quantity.The long quantity and short quantity must be zero or positive, not negative. In many cases, only a long quantity or short quantity will be present with the other set to zero. However it is also possible for both to be non-zero, allowing long and short positions to be treated separately.
- Parameters:
positionInfo- the position informationproduct- the underlying productlongQuantity- the long quantity of the underlying securityshortQuantity- the short quantity of the underlying security- Returns:
- the position
-
getSecurityId
public SecurityId getSecurityId()
Description copied from interface:PositionGets the identifier of the underlying security.This identifier uniquely identifies the security within the system.
- Specified by:
getSecurityIdin interfacePosition- Specified by:
getSecurityIdin interfaceSecuritizedProductPortfolioItem<OvernightFuture>- Specified by:
getSecurityIdin interfaceSecuritizedProductPosition<OvernightFuture>- Specified by:
getSecurityIdin interfaceSecurityQuantity- Returns:
- the security identifier
-
getCurrency
public Currency getCurrency()
Description copied from interface:SecuritizedProductPortfolioItemGets the currency of the position.This is typically the same as the currency of the product.
- Specified by:
getCurrencyin interfaceSecuritizedProductPortfolioItem<OvernightFuture>- Returns:
- the trading currency
-
getQuantity
public double getQuantity()
Description copied from interface:PositionGets the net quantity of the security.This returns the net quantity of the underlying security. The result is positive if the net position is long and negative if the net position is short.
- Specified by:
getQuantityin interfacePosition- Specified by:
getQuantityin interfaceSecurityQuantity- Returns:
- the net quantity of the underlying security
-
withInfo
public OvernightFuturePosition withInfo(PortfolioItemInfo info)
Description copied from interface:SecuritizedProductPositionReturns an instance with the specified info.- Specified by:
withInfoin interfacePortfolioItem- Specified by:
withInfoin interfacePosition- Specified by:
withInfoin interfaceSecuritizedProductPosition<OvernightFuture>- Parameters:
info- the new info- Returns:
- the instance with the specified info
-
withQuantity
public OvernightFuturePosition withQuantity(double quantity)
Description copied from interface:SecuritizedProductPositionReturns an instance with the specified quantity.- Specified by:
withQuantityin interfacePosition- Specified by:
withQuantityin interfaceSecuritizedProductPortfolioItem<OvernightFuture>- Specified by:
withQuantityin interfaceSecuritizedProductPosition<OvernightFuture>- Parameters:
quantity- the new quantity- Returns:
- the instance with the specified quantity
-
summarize
public PortfolioItemSummary summarize()
Description copied from interface:PortfolioItemSummarizes the portfolio item.This provides a summary, including a human readable description.
- Specified by:
summarizein interfacePortfolioItem- Specified by:
summarizein interfacePosition- Returns:
- the summary of the item
-
resolve
public ResolvedOvernightFutureTrade resolve(ReferenceData refData)
Description copied from interface:ResolvableResolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataIdidentifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolvein interfaceResolvable<ResolvedOvernightFutureTrade>- Parameters:
refData- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static OvernightFuturePosition.Meta meta()
The meta-bean forOvernightFuturePosition.- Returns:
- the meta-bean, not null
-
builder
public static OvernightFuturePosition.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public OvernightFuturePosition.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getInfo
public PositionInfo getInfo()
Gets the additional position information, defaulted to an empty instance.This allows additional information to be attached to the position.
- Specified by:
getInfoin interfacePortfolioItem- Specified by:
getInfoin interfacePosition- Returns:
- the value of the property, not null
-
getProduct
public OvernightFuture getProduct()
Gets the future that was traded.The product captures the contracted financial details.
- Specified by:
getProductin interfaceSecuritizedProductPortfolioItem<OvernightFuture>- Returns:
- the value of the property, not null
-
getLongQuantity
public double getLongQuantity()
Gets the long quantity of the security.This is the quantity of the underlying security that is held. The quantity cannot be negative, as that would imply short selling.
- Returns:
- the value of the property
-
getShortQuantity
public double getShortQuantity()
Gets the short quantity of the security.This is the quantity of the underlying security that has been short sold. The quantity cannot be negative, as that would imply the position is long.
- Returns:
- the value of the property
-
toBuilder
public OvernightFuturePosition.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-