Class FxVanillaOption
- java.lang.Object
-
- com.opengamma.strata.product.fxopt.FxVanillaOption
-
- All Implemented Interfaces:
Resolvable<ResolvedFxVanillaOption>
,FxOptionProduct
,FxProduct
,Product
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class FxVanillaOption extends Object implements FxOptionProduct, Resolvable<ResolvedFxVanillaOption>, org.joda.beans.ImmutableBean, Serializable
A vanilla FX option.An FX option is a financial instrument that provides an option based on the future value of a foreign exchange. The option is European, exercised only on the exercise date.
For example, a call on a 'EUR 1.00 / USD -1.41' exchange is the option to perform a foreign exchange on the expiry date, where USD 1.41 is paid to receive EUR 1.00.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FxVanillaOption.Builder
The bean-builder forFxVanillaOption
.static class
FxVanillaOption.Meta
The meta-bean forFxVanillaOption
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FxVanillaOption.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
CurrencyPair
getCurrencyPair()
Gets currency pair of the base currency and counter currency.ZonedDateTime
getExpiry()
Gets the expiry date-time.LocalDate
getExpiryDate()
Gets the expiry date of the option.LocalTime
getExpiryTime()
Gets the expiry time of the option.ZoneId
getExpiryZone()
Gets the time-zone of the expiry time.LongShort
getLongShort()
Gets whether the option is long or short.FxSingle
getUnderlying()
Gets the underlying foreign exchange transaction.int
hashCode()
static FxVanillaOption.Meta
meta()
The meta-bean forFxVanillaOption
.FxVanillaOption.Meta
metaBean()
static FxVanillaOption
of(LongShort longShort, ZonedDateTime expiry, CurrencyPair currencyPair, PutCall putCall, double strike, double baseNotional, LocalDate paymentDate)
Creates an equivalentFxVanillaOption
using currency pair, option expiry, call/put flag, strike, base currency notional, and underlying payment date.ResolvedFxVanillaOption
resolve(ReferenceData refData)
Resolves this object using the specified reference data.FxVanillaOption.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.fx.FxProduct
allCurrencies, isCrossCurrency
-
Methods inherited from interface com.opengamma.strata.product.Product
allPaymentCurrencies
-
-
-
-
Method Detail
-
of
public static FxVanillaOption of(LongShort longShort, ZonedDateTime expiry, CurrencyPair currencyPair, PutCall putCall, double strike, double baseNotional, LocalDate paymentDate)
Creates an equivalentFxVanillaOption
using currency pair, option expiry, call/put flag, strike, base currency notional, and underlying payment date.- Parameters:
longShort
- the long/short flag of the optionexpiry
- the option expirycurrencyPair
- the FX currency pairputCall
- the put/call flag of the optionstrike
- the FX strikebaseNotional
- the base currency notional amount: should always be positivepaymentDate
- the payment date of the underlying FX cash flows- Returns:
- an equivalent fx vanilla option
-
getCurrencyPair
public CurrencyPair getCurrencyPair()
Gets currency pair of the base currency and counter currency.This currency pair is conventional, thus indifferent to the direction of FX.
- Specified by:
getCurrencyPair
in interfaceFxProduct
- Returns:
- the currency pair
-
getExpiry
public ZonedDateTime getExpiry()
Gets the expiry date-time.The option expires at this date and time.
The result is returned by combining the expiry date, time and time-zone.
- Specified by:
getExpiry
in interfaceFxOptionProduct
- Returns:
- the expiry date and time
-
resolve
public ResolvedFxVanillaOption resolve(ReferenceData refData)
Description copied from interface:Resolvable
Resolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataId
identifiers 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:
resolve
in interfaceResolvable<ResolvedFxVanillaOption>
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static FxVanillaOption.Meta meta()
The meta-bean forFxVanillaOption
.- Returns:
- the meta-bean, not null
-
builder
public static FxVanillaOption.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public FxVanillaOption.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getLongShort
public LongShort getLongShort()
Gets whether the option is long or short.At expiry, the long party will have the option to enter in this transaction; the short party will, at the option of the long party, potentially enter into the inverse transaction.
- Returns:
- the value of the property, not null
-
getExpiryDate
public LocalDate getExpiryDate()
Gets the expiry date of the option.The option is European, and can only be exercised on the expiry date.
- Returns:
- the value of the property, not null
-
getExpiryTime
public LocalTime getExpiryTime()
Gets the expiry time of the option.The expiry time is related to the expiry date and time-zone.
- Returns:
- the value of the property, not null
-
getExpiryZone
public ZoneId getExpiryZone()
Gets the time-zone of the expiry time.The expiry time-zone is related to the expiry date and time.
- Returns:
- the value of the property, not null
-
getUnderlying
public FxSingle getUnderlying()
Gets the underlying foreign exchange transaction.At expiry, if the option is in the money, this foreign exchange will occur.
- Returns:
- the value of the property, not null
-
toBuilder
public FxVanillaOption.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-