public final class EtdOptionSecurity extends Object implements EtdSecurity, org.joda.beans.ImmutableBean, Serializable
A security representing a standardized contract that gives the buyer the right but not the obligation to buy or sell an underlying asset at an agreed price.
| Modifier and Type | Class and Description |
|---|---|
static class |
EtdOptionSecurity.Builder
The bean-builder for
EtdOptionSecurity. |
static class |
EtdOptionSecurity.Meta
The meta-bean for
EtdOptionSecurity. |
| Modifier and Type | Method and Description |
|---|---|
static EtdOptionSecurity.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
EtdOptionPosition |
createPosition(PositionInfo positionInfo,
double longQuantity,
double shortQuantity,
ReferenceData refData)
Creates a position based on this security from a long and short quantity.
|
EtdOptionPosition |
createPosition(PositionInfo positionInfo,
double quantity,
ReferenceData refData)
Creates a position based on this security from a net quantity.
|
EtdOptionSecurity |
createProduct(ReferenceData refData)
Creates the product associated with this security.
|
EtdOptionTrade |
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.
|
PutCall |
getPutCall()
Gets whether the option is a put or call.
|
double |
getStrikePrice()
Gets the strike price, in decimal form, may be negative.
|
EtdType |
getType()
Gets the type of the contract - future or option.
|
Optional<YearMonth> |
getUnderlyingExpiryMonth()
Gets the expiry year-month of the underlying instrument.
|
EtdVariant |
getVariant()
Gets the variant of ETD.
|
int |
getVersion()
Gets the version of the option, defaulted to zero.
|
int |
hashCode() |
static EtdOptionSecurity.Meta |
meta()
The meta-bean for
EtdOptionSecurity. |
EtdOptionSecurity.Meta |
metaBean() |
static EtdOptionSecurity |
of(EtdContractSpec spec,
YearMonth expiry,
EtdVariant variant,
int version,
PutCall putCall,
double strikePrice)
Obtains an instance from a contract specification, expiry year-month, variant, version, put/call and strike price.
|
static EtdOptionSecurity |
of(EtdContractSpec spec,
YearMonth expiry,
EtdVariant variant,
int version,
PutCall putCall,
double strikePrice,
YearMonth underlyingExpiryMonth)
Obtains an instance from a contract specification, expiry year-month, variant,
version, put/call, strike price and underlying expiry.
|
String |
summaryDescription()
Summarizes this ETD option into string form.
|
EtdOptionSecurity.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
EtdOptionSecurity |
withInfo(SecurityInfo info)
Returns an instance with the specified info.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCurrency, getSecurityId, getUnderlyingIdsallCurrenciesallPaymentCurrencies, isCrossCurrencypublic static EtdOptionSecurity of(EtdContractSpec spec, YearMonth expiry, EtdVariant variant, int version, PutCall putCall, double strikePrice)
The security identifier will be automatically created using EtdIdUtils.
The specification must be for an option.
spec - the option contract specificationexpiry - the expiry year-month of the optionvariant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'version - the non-negative version, zero if versioning does not applyputCall - 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 static EtdOptionSecurity of(EtdContractSpec spec, YearMonth expiry, EtdVariant variant, int version, PutCall putCall, double strikePrice, YearMonth underlyingExpiryMonth)
The security identifier will be automatically created using EtdIdUtils.
The specification must be for an option.
spec - the option contract specificationexpiry - the expiry year-month of the optionvariant - the variant of the ETD, such as 'Monthly', 'Weekly, 'Daily' or 'Flex'version - the non-negative version, zero if versioning does not applyputCall - whether the option is a put or callstrikePrice - the strike price of the optionunderlyingExpiryMonth - the expiry of the underlying instrument, such as a future, may be nullIllegalStateException - if the product type of the contract specification is not OPTIONpublic EtdType getType()
EtdSecuritygetType in interface EtdSecuritypublic EtdOptionSecurity withInfo(SecurityInfo info)
SecuritywithInfo in interface EtdSecuritywithInfo in interface Securityinfo - the new infopublic EtdOptionSecurity 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 EtdOptionTrade 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 EtdOptionPosition 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 EtdOptionPosition 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 EtdOptionSecurity.Meta meta()
EtdOptionSecurity.public static EtdOptionSecurity.Builder builder()
public EtdOptionSecurity.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 int getVersion()
Some options can have multiple versions, representing some kind of change over time. Version zero is the baseline, version one and later indicates some kind of change occurred.
public PutCall getPutCall()
public double getStrikePrice()
public Optional<YearMonth> getUnderlyingExpiryMonth()
If an option has an underlying instrument, the expiry of that instrument can be specified here. For example, you can have an option expiring in March on the underlying March future, or on the underlying June future. Not all options have an underlying instrument, thus the property is optional.
In many cases, the expiry of the underlying instrument is the same as the expiry of the option. In this case, the expiry is often omitted, even though it probably should not be.
public EtdOptionSecurity.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.