public interface TermDepositConvention extends TradeConvention, Named
This defines the market convention for a term deposit.
To manually create a convention, see ImmutableTermDepositConvention.
To register a specific convention, see TermDepositConvention.ini.
| Modifier and Type | Method and Description |
|---|---|
default LocalDate |
calculateSpotDateFromTradeDate(LocalDate tradeDate,
ReferenceData refData)
Calculates the spot date from the trade date.
|
default TermDepositTrade |
createTrade(LocalDate tradeDate,
MarketTenor marketTenor,
BuySell buySell,
double notional,
double rate,
ReferenceData refData)
Creates a trade based on this convention using a market tenor, such as ON, TN, SN, SW or 1M.
|
default TermDepositTrade |
createTrade(LocalDate tradeDate,
Period depositPeriod,
BuySell buySell,
double notional,
double rate,
ReferenceData refData)
Creates a trade based on this convention.
|
static ExtendedEnum<TermDepositConvention> |
extendedEnum()
Gets the extended enum helper.
|
Currency |
getCurrency()
Gets the primary currency.
|
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 TermDepositConvention |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
default TermDepositTrade |
toTrade(LocalDate tradeDate,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
double notional,
double rate)
Creates a trade based on this convention.
|
TermDepositTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
double notional,
double rate)
Creates a trade based on this convention.
|
static TermDepositConvention of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knownstatic ExtendedEnum<TermDepositConvention> extendedEnum()
This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
Currency getCurrency()
This is the currency of the term deposit and the currency that payment is made in.
DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".
default TermDepositTrade createTrade(LocalDate tradeDate, MarketTenor marketTenor, BuySell buySell, double notional, double rate, 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 term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.
tradeDate - the date of the trademarketTenor - the market tenor, defining the spot lag and tenorbuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templaterate - the fixed rate, typically derived from the marketrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault TermDepositTrade createTrade(LocalDate tradeDate, Period depositPeriod, BuySell buySell, double notional, double rate, ReferenceData refData)
This returns a trade based on the specified deposit period, starting from the spot date.
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.
tradeDate - the date of the tradedepositPeriod - the period between the start date and the end datebuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templaterate - the fixed rate, typically derived from the marketrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault TermDepositTrade toTrade(LocalDate tradeDate, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double rate)
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 term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.
tradeDate - the date of the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templaterate - the fixed rate, typically derived from the marketTermDepositTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double rate)
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 term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.
tradeInfo - additional information about the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templaterate - the fixed rate, typically derived from the marketdefault 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.