public final class ImmutableFxSwapConvention extends Object implements FxSwapConvention, org.joda.beans.ImmutableBean, Serializable
This defines the market convention for a FX swap based on a particular currency pair.
The convention is defined by four dates.
FxSwapTemplate, not by this convention.| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableFxSwapConvention.Builder
The bean-builder for
ImmutableFxSwapConvention. |
static class |
ImmutableFxSwapConvention.Meta
The meta-bean for
ImmutableFxSwapConvention. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableFxSwapConvention.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
BusinessDayAdjustment |
getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date,
providing a default result if no override specified.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair associated with the convention.
|
String |
getName()
Gets the name that uniquely identifies this convention.
|
DaysAdjustment |
getSpotDateOffset()
Gets the offset of the spot value date from the trade date.
|
int |
hashCode() |
static ImmutableFxSwapConvention.Meta |
meta()
The meta-bean for
ImmutableFxSwapConvention. |
ImmutableFxSwapConvention.Meta |
metaBean() |
static ImmutableFxSwapConvention |
of(CurrencyPair currencyPair,
DaysAdjustment spotDateOffset)
Obtains a convention based on the specified currency pair and spot date offset.
|
static ImmutableFxSwapConvention |
of(CurrencyPair currencyPair,
DaysAdjustment spotDateOffset,
BusinessDayAdjustment businessDayAdjustment)
Obtains a convention based on the specified currency pair, spot date offset and adjustment.
|
ImmutableFxSwapConvention.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
FxSwapTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
Currency buySellCurrency,
double notional,
double nearFxRate,
double farLegForwardPoints)
Creates a trade based on this convention.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcalculateSpotDateFromTradeDate, createTrade, createTrade, createTrade, createTrade, extendedEnum, of, of, toTrade, toTrade, toTradepublic static ImmutableFxSwapConvention of(CurrencyPair currencyPair, DaysAdjustment spotDateOffset)
Use the builder for unusual conventions.
currencyPair - the currency pair associated to the conventionspotDateOffset - the spot date offsetpublic static ImmutableFxSwapConvention of(CurrencyPair currencyPair, DaysAdjustment spotDateOffset, BusinessDayAdjustment businessDayAdjustment)
Use the builder for unusual conventions.
currencyPair - the currency pair associated to the conventionspotDateOffset - the spot date offsetbusinessDayAdjustment - the business day adjustment to applypublic String getName()
FxSwapConvention
This name is used in serialization and can be parsed using FxSwapConvention.of(String).
getName in interface NamedgetName in interface FxSwapConventionpublic BusinessDayAdjustment getBusinessDayAdjustment()
The start and end date are typically defined as valid business days and thus do not need to be adjusted. If this optional property is present, then the start and end date will be adjusted as defined here.
This will default to 'ModifiedFollowing' using the spot date offset calendar if not specified.
public FxSwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, Currency buySellCurrency, double notional, double nearFxRate, double farLegForwardPoints)
FxSwapConventionThis returns a trade based on the specified dates. The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FX Swap, the amount in the specified currency is received in the near leg and paid in the far leg.
toTrade in interface FxSwapConventiontradeInfo - additional information about the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagbuySellCurrency - the currency being bought/soldnotional - the unsigned notional amount, in the buy/sell currencynearFxRate - the FX rate for the near legfarLegForwardPoints - the FX points to be added to the FX rate at the far legpublic static ImmutableFxSwapConvention.Meta meta()
ImmutableFxSwapConvention.public static ImmutableFxSwapConvention.Builder builder()
public ImmutableFxSwapConvention.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurrencyPair getCurrencyPair()
getCurrencyPair in interface FxSwapConventionpublic DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date and is typically plus 2 business days in the joint calendar of the two currencies. The start and end date of the FX swap are relative to the spot date.
getSpotDateOffset in interface FxSwapConventionpublic ImmutableFxSwapConvention.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.