public final class EtdContractSpec extends Object implements Attributes, Described, org.joda.beans.ImmutableBean, Serializable
This can represent a future or an option. Instances of EtdOptionSecurity or EtdFutureSecurity
can be created using the createFuture and createOption methods and providing the information
required to fully define the contract such as the expiry, strike price and put / call.
| Modifier and Type | Class and Description |
|---|---|
static class |
EtdContractSpec.Meta
The meta-bean for
EtdContractSpec. |
| Modifier and Type | Method and Description |
|---|---|
static EtdContractSpecBuilder |
builder()
Returns a builder for building instances of
EtdContractSpec. |
EtdFutureSecurity |
createFuture(YearMonth expiryMonth,
EtdVariant variant)
Creates a future security based on this contract specification.
|
EtdOptionSecurity |
createOption(YearMonth expiryMonth,
EtdVariant variant,
int version,
PutCall putCall,
double strikePrice)
Creates an option security based on this contract specification.
|
EtdOptionSecurity |
createOption(YearMonth expiryMonth,
EtdVariant variant,
int version,
PutCall putCall,
double strikePrice,
YearMonth underlyingExpiryMonth)
Creates an option security based on this contract specification.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findAttribute(AttributeType<T> type)
Finds the attribute associated with the specified type.
|
ImmutableMap<AttributeType<?>,Object> |
getAttributes()
Gets the attributes.
|
ImmutableSet<AttributeType<?>> |
getAttributeTypes()
Gets the attribute types that are available.
|
EtdContractCode |
getContractCode()
Gets the code supplied by the exchange for use in clearing and margining, such as in SPAN.
|
String |
getDescription()
Gets the human readable description of the product.
|
ExchangeId |
getExchangeId()
Gets the ID of the exchange where the instruments derived from the product are traded.
|
EtdContractSpecId |
getId()
Gets the ID of this contract specification.
|
SecurityPriceInfo |
getPriceInfo()
Gets the information about the security price.
|
EtdType |
getType()
Gets the type of the contract - future or option.
|
int |
hashCode() |
static EtdContractSpec.Meta |
meta()
The meta-bean for
EtdContractSpec. |
EtdContractSpec.Meta |
metaBean() |
String |
toString() |
<T> EtdContractSpec |
withAttribute(AttributeType<T> type,
T value)
Returns a copy of this instance with the attribute added.
|
EtdContractSpec |
withAttributes(Attributes other)
Returns a copy of this instance with the attributes added.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAttribute, containsAttribute, empty, getAttribute, ofpublic static EtdContractSpecBuilder builder()
EtdContractSpec.
The builder will create an identifier using EtdIdUtils if it is not set.
EtdContractSpecpublic ImmutableSet<AttributeType<?>> getAttributeTypes()
Attributes
See AttributeType.captureWildcard() for a way to capture the wildcard type.
The default implementation returns an empty set (backwards compatibility prevents an abstract method for now).
getAttributeTypes in interface Attributespublic <T> Optional<T> findAttribute(AttributeType<T> type)
AttributesThis method obtains the specified attribute. This allows an attribute to be obtained if available.
If the attribute is not found, optional empty is returned.
findAttribute in interface AttributesT - the type of the resulttype - the type to findpublic <T> EtdContractSpec withAttribute(AttributeType<T> type, T value)
Attributes
This returns a new instance with the specified attribute added.
The attribute is added using Map.put(type, value) semantics.
withAttribute in interface AttributesT - the type of the attribute valuetype - the type providing meaning to the valuevalue - the valuepublic EtdContractSpec withAttributes(Attributes other)
Attributes
This returns a new instance with the specified attributes added.
The attributes are added using Map.putAll(type, value) semantics.
withAttributes in interface Attributesother - the other instance to copy frompublic EtdFutureSecurity createFuture(YearMonth expiryMonth, EtdVariant variant)
The security identifier will be automatically created using EtdIdUtils.
The type must be EtdType.FUTURE otherwise an exception will be thrown.
expiryMonth - the expiry 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 EtdOptionSecurity createOption(YearMonth expiryMonth, EtdVariant variant, int version, PutCall putCall, double strikePrice)
The security identifier will be automatically created using EtdIdUtils.
The type must be EtdType.OPTION otherwise an exception will be thrown.
expiryMonth - the expiry month of the optionvariant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'version - the non-negative version, zero by defaultputCall - whether the option is a put or callstrikePrice - the strike price of the optionIllegalStateException - if the product type of the contract specification is not OPTIONpublic EtdOptionSecurity createOption(YearMonth expiryMonth, EtdVariant variant, int version, PutCall putCall, double strikePrice, YearMonth underlyingExpiryMonth)
The security identifier will be automatically created using EtdIdUtils.
The type must be EtdType.OPTION otherwise an exception will be thrown.
expiryMonth - the expiry month of the optionvariant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'version - the non-negative version, zero by defaultputCall - whether the option is a put or callstrikePrice - the strike price of the optionunderlyingExpiryMonth - the expiry of the underlying instrument, such as a futureIllegalStateException - if the product type of the contract specification is not OPTIONpublic static EtdContractSpec.Meta meta()
EtdContractSpec.public EtdContractSpec.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic EtdContractSpecId getId()
When building, this will be defaulted using EtdIdUtils.
public EtdType getType()
public ExchangeId getExchangeId()
public EtdContractCode getContractCode()
public String getDescription()
getDescription in interface Describedpublic SecurityPriceInfo getPriceInfo()
public ImmutableMap<AttributeType<?>,Object> getAttributes()
Attributes provide the ability to associate arbitrary information with a security contract specification in a key-value map.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.