public interface FxSwapConvention extends TradeConvention, Named
This defines the market convention for a FX swap based on a particular currency pair.
To manually create a convention, see ImmutableFxSwapConvention.
To register a specific convention, see FxSwapConvention.ini.
| Modifier and Type | Method and Description |
|---|---|
default LocalDate |
calculateSpotDateFromTradeDate(LocalDate tradeDate,
ReferenceData refData)
Calculates the spot date from the trade date.
|
default FxSwapTrade |
createTrade(LocalDate tradeDate,
MarketTenor marketTenor,
BuySell buySell,
Currency buySellCurrency,
double buySellNotional,
double nearFxRate,
double farLegForwardPoints,
ReferenceData refData)
Creates a trade based on this convention using a market tenor, such as ON, TN, SN, SW or 1M.
|
default FxSwapTrade |
createTrade(LocalDate tradeDate,
MarketTenor marketTenor,
BuySell buySell,
double notional,
double nearFxRate,
double farLegForwardPoints,
ReferenceData refData)
Creates a trade based on this convention using a market tenor, such as ON, TN, SN, SW or 1M.
|
default FxSwapTrade |
createTrade(LocalDate tradeDate,
Period periodToNear,
Period periodToFar,
BuySell buySell,
Currency buySellCurrency,
double buySellNotional,
double nearFxRate,
double farLegForwardPoints,
ReferenceData refData)
Creates a trade based on this convention.
|
default FxSwapTrade |
createTrade(LocalDate tradeDate,
Period periodToNear,
Period periodToFar,
BuySell buySell,
double notional,
double nearFxRate,
double farLegForwardPoints,
ReferenceData refData)
Creates a trade based on this convention.
|
static ExtendedEnum<FxSwapConvention> |
extendedEnum()
Gets the extended enum helper.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair of 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.
|
static FxSwapConvention |
of(CurrencyPair currencyPair)
Obtains the standard convention for the specified currency pair.
|
static FxSwapConvention |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
default FxSwapTrade |
toTrade(LocalDate tradeDate,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
Currency buySellCurrency,
double buySellNotional,
double nearFxRate,
double farLegForwardPoints)
Creates a trade based on this convention.
|
default FxSwapTrade |
toTrade(LocalDate tradeDate,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
double notional,
double nearFxRate,
double farLegForwardPoints)
Creates a trade based on this convention.
|
FxSwapTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
Currency buySellCurrency,
double buySellNotional,
double nearFxRate,
double farLegForwardPoints)
Creates a trade based on this convention.
|
default FxSwapTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
double notional,
double nearFxRate,
double farLegForwardPoints)
Creates a trade based on this convention.
|
static FxSwapConvention of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knownstatic FxSwapConvention of(CurrencyPair currencyPair)
The convention accessed will be for the conventional order of the currency pair.
currencyPair - the currency pair to get the convention forIllegalArgumentException - if no convention has been defined for the pairstatic ExtendedEnum<FxSwapConvention> extendedEnum()
This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
CurrencyPair getCurrencyPair()
DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".
default FxSwapTrade createTrade(LocalDate tradeDate, MarketTenor marketTenor, BuySell buySell, double notional, double nearFxRate, double farLegForwardPoints, ReferenceData refData)
This returns a trade based on the market tenor. If the market tenor is ON or TN, the spot lag of the convention will be overridden.
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FX Swap, the amount in the first currency of the pair is received in the near leg and paid in the far leg, while the second currency is paid in the near leg and received in the far leg.
tradeDate - the date of the trademarketTenor - the market tenor, defining the spot lag and tenorbuySell - the buy/sell flag, relative to the first currency of the currency pairnotional - the notional amount, in the first currency of the currency pairnearFxRate - the FX rate for the near legfarLegForwardPoints - the FX points to be added to the FX rate at the far legrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault FxSwapTrade createTrade(LocalDate tradeDate, MarketTenor marketTenor, BuySell buySell, Currency buySellCurrency, double buySellNotional, double nearFxRate, double farLegForwardPoints, ReferenceData refData)
This returns a trade based on the market tenor. If the market tenor is ON or TN, the spot lag of the convention will be overridden.
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.
tradeDate - the date of the trademarketTenor - the market tenor, defining the spot lag and tenorbuySell - the buy/sell flagbuySellCurrency - the currency being bought/soldbuySellNotional - 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 legrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault FxSwapTrade createTrade(LocalDate tradeDate, Period periodToNear, Period periodToFar, BuySell buySell, double notional, double nearFxRate, double farLegForwardPoints, ReferenceData refData)
This returns a trade based on the specified periods, starting from the spot date. For example, a '3M x 6M' FX swap has a period from spot to the start date of 3 months and a period from spot to the end date of 6 months
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FX Swap, the amount in the first currency of the pair is received in the near leg and paid in the far leg, while the second currency is paid in the near leg and received in the far leg.
tradeDate - the date of the tradeperiodToNear - the period between the spot date and the near dateperiodToFar - the period between the spot date and the far datebuySell - the buy/sell flag, relative to the first currency of the currency pairnotional - the notional amount, in the first currency of the currency pairnearFxRate - the FX rate for the near legfarLegForwardPoints - the FX points to be added to the FX rate at the far legrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault FxSwapTrade createTrade(LocalDate tradeDate, Period periodToNear, Period periodToFar, BuySell buySell, Currency buySellCurrency, double buySellNotional, double nearFxRate, double farLegForwardPoints, ReferenceData refData)
This returns a trade based on the specified periods, starting from the spot date. For example, a '3M x 6M' FX swap has a period from spot to the start date of 3 months and a period from spot to the end date of 6 months
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.
tradeDate - the date of the tradeperiodToNear - the period between the spot date and the near dateperiodToFar - the period between the spot date and the far datebuySell - the buy/sell flagbuySellCurrency - the currency being bought/soldbuySellNotional - 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 legrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault FxSwapTrade toTrade(LocalDate tradeDate, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double nearFxRate, double farLegForwardPoints)
This 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 first currency of the pair is received in the near leg and paid in the far leg, while the second currency is paid in the near leg and received in the far leg.
tradeDate - the date of the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flag, relative to the first currency of the currency pairnotional - the notional amount, in the first currency of the currency pairnearFxRate - the FX rate for the near legfarLegForwardPoints - the FX points to be added to the FX rate at the far legdefault FxSwapTrade toTrade(LocalDate tradeDate, LocalDate startDate, LocalDate endDate, BuySell buySell, Currency buySellCurrency, double buySellNotional, double nearFxRate, double farLegForwardPoints)
This 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.
tradeDate - the date of the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagbuySellCurrency - the currency being bought/soldbuySellNotional - 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 legdefault FxSwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double nearFxRate, double farLegForwardPoints)
This 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 first currency of the pair is received in the near leg and paid in the far leg, while the second currency is paid in the near leg and received in the far leg.
tradeInfo - additional information about the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flag, relative to the first currency of the currency pairnotional - the notional amount, in the first currency of the currency pairnearFxRate - the FX rate for the near legfarLegForwardPoints - the FX points to be added to the FX rate at the far legFxSwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, Currency buySellCurrency, double buySellNotional, double nearFxRate, double farLegForwardPoints)
This 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.
tradeInfo - additional information about the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagbuySellCurrency - the currency being bought/soldbuySellNotional - 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 legdefault LocalDate calculateSpotDateFromTradeDate(LocalDate tradeDate, ReferenceData refData)
tradeDate - the trade daterefData - the reference data, used to resolve the dateReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataString getName()
This name is used in serialization and can be parsed using of(String).
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.