public final class XCcyOvernightOvernightSwapTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
This defines almost all the data necessary to create a overnight-overnight cross-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 market price is typically quoted as a spread on one leg.
The template references four dates.
| Modifier and Type | Class and Description |
|---|---|
static class |
XCcyOvernightOvernightSwapTemplate.Builder
The bean-builder for
XCcyOvernightOvernightSwapTemplate. |
static class |
XCcyOvernightOvernightSwapTemplate.Meta
The meta-bean for
XCcyOvernightOvernightSwapTemplate. |
| Modifier and Type | Method and Description |
|---|---|
static XCcyOvernightOvernightSwapTemplate.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
SwapTrade |
createTrade(LocalDate tradeDate,
BuySell buySell,
double notionalSpreadLeg,
double notionalFlatLeg,
double spread,
ReferenceData refData)
Creates a trade based on this template.
|
boolean |
equals(Object obj) |
XCcyOvernightOvernightSwapConvention |
getConvention()
Gets the market convention of the swap.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair of the template.
|
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 XCcyOvernightOvernightSwapTemplate.Meta |
meta()
The meta-bean for
XCcyOvernightOvernightSwapTemplate. |
XCcyOvernightOvernightSwapTemplate.Meta |
metaBean() |
static XCcyOvernightOvernightSwapTemplate |
of(Period periodToStart,
Tenor tenor,
XCcyOvernightOvernightSwapConvention convention)
Obtains a template based on the specified period, tenor and convention.
|
static XCcyOvernightOvernightSwapTemplate |
of(Tenor tenor,
XCcyOvernightOvernightSwapConvention convention)
Obtains a template based on the specified tenor and convention.
|
XCcyOvernightOvernightSwapTemplate.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public static XCcyOvernightOvernightSwapTemplate of(Tenor tenor, XCcyOvernightOvernightSwapConvention convention)
The swap will start on the spot date.
tenor - the tenor of the swapconvention - the market conventionpublic static XCcyOvernightOvernightSwapTemplate of(Period periodToStart, Tenor tenor, XCcyOvernightOvernightSwapConvention convention)
The period from the spot date to the start date is specified. The tenor from the start date to the end date is also specified.
periodToStart - the period between the spot date and the start datetenor - the tenor of the swapconvention - the market conventionpublic CurrencyPair getCurrencyPair()
public SwapTrade createTrade(LocalDate tradeDate, BuySell buySell, double notionalSpreadLeg, double notionalFlatLeg, 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 flat leg is received, with the rate of the spread leg being paid. If selling the swap, the opposite occurs.
tradeDate - the date of the tradebuySell - the buy/sell flagnotionalSpreadLeg - the notional amount for the spread legnotionalFlatLeg - the notional amount for the flat legspread - 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 XCcyOvernightOvernightSwapTemplate.Meta meta()
XCcyOvernightOvernightSwapTemplate.public static XCcyOvernightOvernightSwapTemplate.Builder builder()
public XCcyOvernightOvernightSwapTemplate.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 XCcyOvernightOvernightSwapConvention getConvention()
public XCcyOvernightOvernightSwapTemplate.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.