## Class FxSingleBarrierOption

• java.lang.Object
• com.opengamma.strata.product.fxopt.FxSingleBarrierOption
• All Implemented Interfaces:
Resolvable<ResolvedFxSingleBarrierOption>, FxProduct, Product, java.io.Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

public final class FxSingleBarrierOption
extends java.lang.Object
implements FxProduct, Resolvable<ResolvedFxSingleBarrierOption>, org.joda.beans.ImmutableBean, java.io.Serializable
FX (European) single barrier option.

An FX option is a financial instrument that provides an option to exchange two currencies at a specified future time only when barrier event occurs (knock-in option) or does not occur (knock-out option).

Depending on the barrier defined in Barrier, the options are classified into four types: up-and-in, down-and-in, up-and-out and down-and-out.

For example, an up-and-out call on a 'EUR 1.00 / USD -1.41' exchange with barrier of 1.5 is the option to perform a foreign exchange on the expiry date, where USD 1.41 is paid to receive EUR 1.00, only when EUR/USD rate does not exceed 1.5 during the barrier event observation period.

In case of the occurrence (non-occurrence for knock-in options) of the barrier event, the option becomes worthless, or alternatively, a rebate is made.

Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class Description
static class  FxSingleBarrierOption.Builder
The bean-builder for FxSingleBarrierOption.
static class  FxSingleBarrierOption.Meta
The meta-bean for FxSingleBarrierOption.
• ### Method Summary

All Methods
Modifier and Type Method Description
static FxSingleBarrierOption.Builder builder()
Returns a builder used to create an instance of the bean.
boolean equals​(java.lang.Object obj)
Barrier getBarrier()
Gets the barrier description.
CurrencyPair getCurrencyPair()
Gets currency pair of the base currency and counter currency.
java.util.Optional<CurrencyAmount> getRebate()
Gets for a 'out' option, the amount is paid when the barrier is reached; for a 'in' option, the amount is paid at expiry if the barrier is not reached.
FxVanillaOption getUnderlyingOption()
Gets the underlying FX vanilla option.
int hashCode()
static FxSingleBarrierOption.Meta meta()
The meta-bean for FxSingleBarrierOption.
FxSingleBarrierOption.Meta metaBean()
static FxSingleBarrierOption of​(FxVanillaOption underlyingOption, Barrier barrier)
Obtains FX single barrier option without rebate.
static FxSingleBarrierOption of​(FxVanillaOption underlyingOption, Barrier barrier, CurrencyAmount rebate)
Obtains FX single barrier option with rebate.
ResolvedFxSingleBarrierOption resolve​(ReferenceData refData)
Resolves this object using the specified reference data.
FxSingleBarrierOption.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
java.lang.String toString()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### 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 FxSingleBarrierOption of​(FxVanillaOption underlyingOption,
Barrier barrier,
CurrencyAmount rebate)
Obtains FX single barrier option with rebate.
Parameters:
underlyingOption - the underlying FX vanilla option
barrier - the barrier
rebate - the rebate
Returns:
the instance
• #### of

public static FxSingleBarrierOption of​(FxVanillaOption underlyingOption,
Barrier barrier)
Obtains FX single barrier option without rebate.
Parameters:
underlyingOption - the underlying FX vanilla option
barrier - the barrier
Returns:
the instance
• #### 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 interface FxProduct
Returns:
the currency pair
• #### resolve

public ResolvedFxSingleBarrierOption 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 interface Resolvable<ResolvedFxSingleBarrierOption>
Parameters:
refData - the reference data to use when resolving
Returns:
the resolved instance
• #### meta

public static FxSingleBarrierOption.Meta meta()
The meta-bean for FxSingleBarrierOption.
Returns:
the meta-bean, not null
• #### builder

public static FxSingleBarrierOption.Builder builder()
Returns a builder used to create an instance of the bean.
Returns:
the builder, not null
• #### metaBean

public FxSingleBarrierOption.Meta metaBean()
Specified by:
metaBean in interface org.joda.beans.Bean
• #### getUnderlyingOption

public FxVanillaOption getUnderlyingOption()
Gets the underlying FX vanilla option.
Returns:
the value of the property, not null
• #### getBarrier

public Barrier getBarrier()
Gets the barrier description.

The barrier level stored in this field must be represented based on the direction of the currency pair in the underlying FX transaction.

For example, if the underlying option is an option on EUR/GBP, the barrier should be a certain level of EUR/GBP rate.

Returns:
the value of the property, not null
• #### getRebate

public java.util.Optional<CurrencyAmount> getRebate()
Gets for a 'out' option, the amount is paid when the barrier is reached; for a 'in' option, the amount is paid at expiry if the barrier is not reached.

This is the notional amount represented in one of the currency pair. The amount should be positive.

Returns:
the optional value of the property, not null
• #### toBuilder

public FxSingleBarrierOption.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
Returns:
the mutable builder, not null
• #### equals

public boolean equals​(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
• #### toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object