public final class EtdFutureSecurity extends Object implements EtdSecurity, org.joda.beans.ImmutableBean, Serializable
A security representing a standardized contact between two parties to buy or sell an asset at a future date for an agreed price.
| Modifier and Type | Class and Description |
|---|---|
static class |
EtdFutureSecurity.Builder
The bean-builder for
EtdFutureSecurity. |
static class |
EtdFutureSecurity.Meta
The meta-bean for
EtdFutureSecurity. |
| Modifier and Type | Method and Description |
|---|---|
static EtdFutureSecurity.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
EtdFuturePosition |
createPosition(PositionInfo positionInfo,
double longQuantity,
double shortQuantity,
ReferenceData refData)
Creates a position based on this security from a long and short quantity.
|
EtdFuturePosition |
createPosition(PositionInfo positionInfo,
double quantity,
ReferenceData refData)
Creates a position based on this security from a net quantity.
|
EtdFutureSecurity |
createProduct(ReferenceData refData)
Creates the product associated with this security.
|
EtdFutureTrade |
createTrade(TradeInfo tradeInfo,
double quantity,
double tradePrice,
ReferenceData refData)
Creates a trade based on this security.
|
boolean |
equals(Object obj) |
EtdContractSpecId |
getContractSpecId()
Gets the ID of the contract specification from which this security is derived.
|
YearMonth |
getExpiry()
Gets the year-month of the expiry.
|
SecurityInfo |
getInfo()
Gets the standard security information.
|
EtdType |
getType()
Gets the type of the contract - future or option.
|
EtdVariant |
getVariant()
Gets the variant of ETD.
|
int |
hashCode() |
static EtdFutureSecurity.Meta |
meta()
The meta-bean for
EtdFutureSecurity. |
EtdFutureSecurity.Meta |
metaBean() |
static EtdFutureSecurity |
of(EtdContractSpec spec,
YearMonth expiry,
EtdVariant variant)
Obtains an instance from a contract specification, expiry year-month and variant.
|
String |
summaryDescription()
Summarizes this ETD future into string form.
|
EtdFutureSecurity.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
EtdFutureSecurity |
withInfo(SecurityInfo info)
Returns an instance with the specified info.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCurrency, getSecurityId, getUnderlyingIdsallCurrenciesallPaymentCurrencies, isCrossCurrencypublic static EtdFutureSecurity of(EtdContractSpec spec, YearMonth expiry, EtdVariant variant)
The security identifier will be automatically created using EtdIdUtils.
The specification must be for a future.
spec - the future contract specificationexpiry - the expiry year-month of the futurevariant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'IllegalStateException - if the product type of the contract specification is not FUTUREpublic EtdType getType()
EtdSecuritygetType in interface EtdSecuritypublic EtdFutureSecurity withInfo(SecurityInfo info)
SecuritywithInfo in interface EtdSecuritywithInfo in interface Securityinfo - the new infopublic EtdFutureSecurity createProduct(ReferenceData refData)
SecurityThe 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.
createProduct in interface SecurityrefData - the reference data used to find underlying securitiespublic EtdFutureTrade createTrade(TradeInfo tradeInfo, double quantity, double tradePrice, ReferenceData refData)
SecurityThis creates a trade of a suitable type for this security.
createTrade in interface SecuritytradeInfo - the trade informationquantity - the number of contracts in the tradetradePrice - the price agreed when the trade occurredrefData - the reference data used to find underlying securitiespublic EtdFuturePosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
SecurityThis creates a position of a suitable type for this security.
createPosition in interface SecuritypositionInfo - the position informationquantity - the number of contracts in the positionrefData - the reference data used to find underlying securitiespublic EtdFuturePosition createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
SecurityThis creates a position of a suitable type for this security.
The long quantity and short quantity must be zero or positive, not negative.
createPosition in interface SecuritypositionInfo - the position informationlongQuantity - the long quantity in the positionshortQuantity - the short quantity in the positionrefData - the reference data used to find underlying securitiespublic String summaryDescription()
public static EtdFutureSecurity.Meta meta()
EtdFutureSecurity.public static EtdFutureSecurity.Builder builder()
public EtdFutureSecurity.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic SecurityInfo getInfo()
This includes the security identifier.
public EtdContractSpecId getContractSpecId()
getContractSpecId in interface EtdSecuritypublic YearMonth getExpiry()
Expiry will occur on a date implied by the variant of the ETD.
getExpiry in interface EtdSecuritypublic EtdVariant getVariant()
This captures the variant of the ETD. The most common variant is 'Monthly'. Other variants are 'Weekly', 'Daily' and 'Flex'.
When building, this defaults to 'Monthly'.
getVariant in interface EtdSecuritypublic EtdFutureSecurity.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.