Class XCcyIborIborSwapCurveNode
- java.lang.Object
-
- com.opengamma.strata.market.curve.node.XCcyIborIborSwapCurveNode
-
- All Implemented Interfaces:
CurveNode
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class XCcyIborIborSwapCurveNode extends Object implements CurveNode, org.joda.beans.ImmutableBean, Serializable
A curve node whose instrument is a cross-currency Ibor-Ibor interest rate swap.Two market quotes are required, one for the spread and one for the FX rate.
The spread or market quote is on the first Ibor leg.
The trade produced by the node will be a spread receiver (SELL) for a positive quantity and a payer (BUY) for a negative quantity. This convention is line with other nodes where a positive quantity is similar to long a bond or deposit.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XCcyIborIborSwapCurveNode.Builder
The bean-builder forXCcyIborIborSwapCurveNode
.static class
XCcyIborIborSwapCurveNode.Meta
The meta-bean forXCcyIborIborSwapCurveNode
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XCcyIborIborSwapCurveNode.Builder
builder()
Returns a builder used to create an instance of the bean.LocalDate
date(LocalDate valuationDate, ReferenceData refData)
Calculates the date associated with the node.boolean
equals(Object obj)
double
getAdditionalSpread()
Gets the additional spread added to the market quote.CurveNodeDate
getDate()
Gets the method by which the date of the node is calculated, defaulted to 'End'.CurveNodeDateOrder
getDateOrder()
Gets the date order rules, used to ensure that the dates in the curve are in order.FxRateId
getFxRateId()
Gets the identifier used to obtain the FX rate market value, defaulted from the template.String
getLabel()
Gets the label to use for the node, defaulted.ObservableId
getSpreadId()
Gets the identifier of the market data value which provides the spread.XCcyIborIborSwapTemplate
getTemplate()
Gets the template for the swap associated with this node.int
hashCode()
double
initialGuess(MarketData marketData, ValueType valueType)
Gets the initial guess used for calibrating the node.static XCcyIborIborSwapCurveNode.Meta
meta()
The meta-bean forXCcyIborIborSwapCurveNode
.XCcyIborIborSwapCurveNode.Meta
metaBean()
DatedParameterMetadata
metadata(LocalDate valuationDate, ReferenceData refData)
Returns metadata for the node.static XCcyIborIborSwapCurveNode
of(XCcyIborIborSwapTemplate template, ObservableId spreadId)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template and rate.static XCcyIborIborSwapCurveNode
of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template, rate key and spread.static XCcyIborIborSwapCurveNode
of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread, String label)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template, rate key, spread and label.Set<? extends MarketDataId<?>>
requirements()
Determines the market data that is required by the node.ResolvedSwapTrade
resolvedTrade(double quantity, MarketData marketData, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.ResolvedSwapTrade
sampleResolvedTrade(LocalDate valuationDate, FxRateProvider fxProvider, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.XCcyIborIborSwapCurveNode.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
SwapTrade
trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the instrument at the node.XCcyIborIborSwapCurveNode
withDate(CurveNodeDate date)
Returns a copy of this node with the specified date.
-
-
-
Method Detail
-
of
public static XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template and rate.A suitable default label will be created.
- Parameters:
template
- the template used for building the instrument for the nodespreadId
- the identifier of the market spread used when building the instrument for the node- Returns:
- a node whose instrument is built from the template using a market rate
-
of
public static XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template, rate key and spread.A suitable default label will be created.
- Parameters:
template
- the template defining the node instrumentspreadId
- the identifier of the market spread used when building the instrument for the nodeadditionalSpread
- the additional spread amount added to the market quote- Returns:
- a node whose instrument is built from the template using a market rate
-
of
public static XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread, String label)
Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the specified instrument template, rate key, spread and label.- Parameters:
template
- the template defining the node instrumentspreadId
- the identifier of the market spread used when building the instrument for the nodeadditionalSpread
- the additional spread amount added to the market quotelabel
- the label to use for the node, if null or empty an appropriate default label will be used- Returns:
- a node whose instrument is built from the template using a market rate
-
requirements
public Set<? extends MarketDataId<?>> requirements()
Description copied from interface:CurveNode
Determines the market data that is required by the node.This returns the market data needed to build the trade that the node represents.
- Specified by:
requirements
in interfaceCurveNode
- Returns:
- requirements for the market data needed to build a trade representing the instrument at the node
-
date
public LocalDate date(LocalDate valuationDate, ReferenceData refData)
Description copied from interface:CurveNode
Calculates the date associated with the node.Each curve node has an associated date which defines the x-value in the curve. This date is visible in the parameter metadata.
-
metadata
public DatedParameterMetadata metadata(LocalDate valuationDate, ReferenceData refData)
Description copied from interface:CurveNode
Returns metadata for the node.This provides curve metadata for the node at the specified valuation date.
-
trade
public SwapTrade trade(double quantity, MarketData marketData, ReferenceData refData)
Description copied from interface:CurveNode
Creates a trade representing the instrument at the node.This uses the observed market data to build the trade that the node represents. The reference data is typically used to find the start date of the trade from the valuation date. The resulting trade is not resolved. The notional of the trade is taken from the 'quantity' variable. The quantity is signed and will affect whether the trade is Buy or Sell. The valuation date is defined by the market data.
- Specified by:
trade
in interfaceCurveNode
- Parameters:
quantity
- the quantity or notional of the trademarketData
- the market data required to build a trade for the instrument, including the valuation daterefData
- the reference data, used to resolve the trade dates- Returns:
- a trade representing the instrument at the node
-
resolvedTrade
public ResolvedSwapTrade resolvedTrade(double quantity, MarketData marketData, ReferenceData refData)
Description copied from interface:CurveNode
Creates a resolved trade representing the instrument at the node.This uses the observed market data to build the trade that the node represents. The trade is then resolved using the specified reference data if necessary. The valuation date is defined by the market data.
Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolvedTrade
in interfaceCurveNode
- Parameters:
quantity
- the quantity or notional of the trademarketData
- the market data required to build a trade for the instrument, including the valuation daterefData
- the reference data, used to resolve the trade- Returns:
- a trade representing the instrument at the node
-
sampleResolvedTrade
public ResolvedSwapTrade sampleResolvedTrade(LocalDate valuationDate, FxRateProvider fxProvider, ReferenceData refData)
Description copied from interface:CurveNode
Creates a resolved trade representing the instrument at the node.This uses an arbitrary quantity, typically 1, and an arbitrary market data quote, typically 0, to create a trade. This is useful when the trade is to be used to calculate the current par value. The FX provider is typically only used for cross-currency trades. In many cases,
FxRateProvider.minimal()
can be passed in.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
sampleResolvedTrade
in interfaceCurveNode
- Parameters:
valuationDate
- the valuation datefxProvider
- the FX rate providerrefData
- the reference data, used to resolve the trade- Returns:
- a trade representing the instrument at the node
-
initialGuess
public double initialGuess(MarketData marketData, ValueType valueType)
Description copied from interface:CurveNode
Gets the initial guess used for calibrating the node.This uses the observed market data to select a suitable initial guess. For example, a Fixed-Ibor swap would return the market quote, which is the fixed rate, providing that the value type is 'ZeroRate'. The valuation date is defined by the market data.
This is primarily used as a performance hint. Since the guess is refined by calibration, in most cases any suitable number can be returned, such as zero.
- Specified by:
initialGuess
in interfaceCurveNode
- Parameters:
marketData
- the market data required to build a trade for the instrument, including the valuation datevalueType
- the type of y-value that the curve will contain- Returns:
- the initial guess of the calibrated value
-
withDate
public XCcyIborIborSwapCurveNode withDate(CurveNodeDate date)
Returns a copy of this node with the specified date.- Parameters:
date
- the date to use- Returns:
- the node based on this node with the specified date
-
meta
public static XCcyIborIborSwapCurveNode.Meta meta()
The meta-bean forXCcyIborIborSwapCurveNode
.- Returns:
- the meta-bean, not null
-
builder
public static XCcyIborIborSwapCurveNode.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public XCcyIborIborSwapCurveNode.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getTemplate
public XCcyIborIborSwapTemplate getTemplate()
Gets the template for the swap associated with this node.- Returns:
- the value of the property, not null
-
getFxRateId
public FxRateId getFxRateId()
Gets the identifier used to obtain the FX rate market value, defaulted from the template. This only needs to be specified if using multiple market data sources.- Returns:
- the value of the property, not null
-
getSpreadId
public ObservableId getSpreadId()
Gets the identifier of the market data value which provides the spread.- Returns:
- the value of the property, not null
-
getAdditionalSpread
public double getAdditionalSpread()
Gets the additional spread added to the market quote.- Returns:
- the value of the property
-
getLabel
public String getLabel()
Gets the label to use for the node, defaulted.When building, this will default based on the tenor if not specified.
-
getDate
public CurveNodeDate getDate()
Gets the method by which the date of the node is calculated, defaulted to 'End'.- Returns:
- the value of the property
-
getDateOrder
public CurveNodeDateOrder getDateOrder()
Gets the date order rules, used to ensure that the dates in the curve are in order. If not specified, this will default toCurveNodeDateOrder.DEFAULT
.- Specified by:
getDateOrder
in interfaceCurveNode
- Returns:
- the value of the property, not null
-
toBuilder
public XCcyIborIborSwapCurveNode.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-