public final class ThreeLegBasisSwapTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
This defines almost all the data necessary to create a Fixed-Ibor-Ibor single currency SwapTrade.
The trade date, notional and spread 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 template references four dates.
| Modifier and Type | Class and Description |
|---|---|
static class |
ThreeLegBasisSwapTemplate.Builder
The bean-builder for
ThreeLegBasisSwapTemplate. |
static class |
ThreeLegBasisSwapTemplate.Meta
The meta-bean for
ThreeLegBasisSwapTemplate. |
| Modifier and Type | Method and Description |
|---|---|
static ThreeLegBasisSwapTemplate.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
SwapTrade |
createTrade(LocalDate tradeDate,
BuySell buySell,
double notional,
double spread,
ReferenceData refData)
Creates a trade based on this template.
|
boolean |
equals(Object obj) |
ThreeLegBasisSwapConvention |
getConvention()
Gets the market convention of the swap.
|
Period |
getPeriodToStart()
Gets the period between the spot value date and the start date.
|
Tenor |
getTenor()
Gets the tenor of the swap.
|
int |
hashCode() |
static ThreeLegBasisSwapTemplate.Meta |
meta()
The meta-bean for
ThreeLegBasisSwapTemplate. |
ThreeLegBasisSwapTemplate.Meta |
metaBean() |
static ThreeLegBasisSwapTemplate |
of(Period periodToStart,
Tenor tenor,
ThreeLegBasisSwapConvention convention)
Creates a template based on the specified period, tenor and convention.
|
static ThreeLegBasisSwapTemplate |
of(Tenor tenor,
ThreeLegBasisSwapConvention convention)
Obtains a template based on the specified tenor and convention.
|
ThreeLegBasisSwapTemplate.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public static ThreeLegBasisSwapTemplate of(Tenor tenor, ThreeLegBasisSwapConvention convention)
The swap will start on the spot date.
tenor - the tenor of the swapconvention - the market conventionpublic static ThreeLegBasisSwapTemplate of(Period periodToStart, Tenor tenor, ThreeLegBasisSwapConvention convention)
The period from the spot date to the start date is specified.
periodToStart - the period between the spot date and the start datetenor - the tenor of the swapconvention - the market conventionpublic SwapTrade createTrade(LocalDate tradeDate, BuySell buySell, double notional, double spread, ReferenceData refData)
This returns a trade based on the specified trade date.
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the swap, the rate of the floating flat leg is received from the counterparty, with the rate of the floating spread leg and the spread of the fixed leg being paid. If selling the swap, the opposite occurs.
tradeDate - the date of the tradebuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templatespread - the spread, 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 ThreeLegBasisSwapTemplate.Meta meta()
ThreeLegBasisSwapTemplate.public static ThreeLegBasisSwapTemplate.Builder builder()
public ThreeLegBasisSwapTemplate.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Period getPeriodToStart()
This is often zero, but can be greater if the swap if forward starting. This must not be negative.
public Tenor getTenor()
This is the period from the first accrual date to the last accrual date.
public ThreeLegBasisSwapConvention getConvention()
public ThreeLegBasisSwapTemplate.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.