public final class TermDepositTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
This defines almost all the data necessary to create a TermDeposit.
The trade date, notional and fixed rate are required to complete the template and create the trade.
As such, it is often possible to get a market price for a trade based on the template.
The market price is typically quoted as a bid/ask on the fixed rate.
The template is defined by three dates.
| Modifier and Type | Class and Description |
|---|---|
static class |
TermDepositTemplate.Builder
The bean-builder for
TermDepositTemplate. |
static class |
TermDepositTemplate.Meta
The meta-bean for
TermDepositTemplate. |
| Modifier and Type | Method and Description |
|---|---|
static TermDepositTemplate.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
TermDepositTrade |
createTrade(LocalDate tradeDate,
BuySell buySell,
double notional,
double rate,
ReferenceData refData)
Creates a trade based on this template.
|
boolean |
equals(Object obj) |
TermDepositConvention |
getConvention()
Gets the underlying term deposit convention.
|
Period |
getDepositPeriod()
Gets the period between the start date and the end date.
|
int |
hashCode() |
static TermDepositTemplate.Meta |
meta()
The meta-bean for
TermDepositTemplate. |
TermDepositTemplate.Meta |
metaBean() |
static TermDepositTemplate |
of(Period depositPeriod,
TermDepositConvention convention)
Obtains a template based on the specified period and convention.
|
TermDepositTemplate.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public static TermDepositTemplate of(Period depositPeriod, TermDepositConvention convention)
depositPeriod - the period between the start date and the end dateconvention - the market conventionpublic TermDepositTrade createTrade(LocalDate tradeDate, BuySell buySell, double notional, double rate, ReferenceData refData)
This returns a trade based on the specified 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 tradebuySell - the buy/sell flag, see TermDeposit.getBuySell()notional - 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 datapublic static TermDepositTemplate.Meta meta()
TermDepositTemplate.public static TermDepositTemplate.Builder builder()
public TermDepositTemplate.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Period getDepositPeriod()
public TermDepositConvention getConvention()
This specifies the standard convention of the term deposit to be created.
public TermDepositTemplate.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.