public final class FixedInflationSwapCurveNode extends Object implements CurveNode, org.joda.beans.ImmutableBean, Serializable
The trade produced by the node will be a fixed receiver (SELL) for a positive quantity and a fixed payer (BUY) for a negative quantity.
Modifier and Type | Class and Description |
---|---|
static class |
FixedInflationSwapCurveNode.Builder
The bean-builder for
FixedInflationSwapCurveNode . |
static class |
FixedInflationSwapCurveNode.Meta
The meta-bean for
FixedInflationSwapCurveNode . |
Modifier and Type | Method and Description |
---|---|
static FixedInflationSwapCurveNode.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 fixed rate.
|
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.
|
String |
getLabel()
Gets the label to use for the node, defaulted.
|
ObservableId |
getRateId()
Gets the identifier of the market data value that provides the rate.
|
FixedInflationSwapTemplate |
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 FixedInflationSwapCurveNode.Meta |
meta()
The meta-bean for
FixedInflationSwapCurveNode . |
FixedInflationSwapCurveNode.Meta |
metaBean() |
DatedParameterMetadata |
metadata(LocalDate valuationDate,
ReferenceData refData)
Returns metadata for the node.
|
static FixedInflationSwapCurveNode |
of(FixedInflationSwapTemplate template,
ObservableId rateId)
Returns a curve node for a Fixed-Inflation swap using the specified instrument template and rate key.
|
static FixedInflationSwapCurveNode |
of(FixedInflationSwapTemplate template,
ObservableId rateId,
double additionalSpread)
Returns a curve node for a Fixed-Inflation swap using the specified instrument template, rate key and spread.
|
static FixedInflationSwapCurveNode |
of(FixedInflationSwapTemplate template,
ObservableId rateId,
double additionalSpread,
String label)
Returns a curve node for a Fixed-Inflation swap using the specified instrument template,
rate key, spread and label.
|
Set<ObservableId> |
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.
|
FixedInflationSwapCurveNode.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.
|
FixedInflationSwapCurveNode |
withDate(CurveNodeDate date)
Returns a copy of this node with the specified date.
|
public static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId)
A suitable default label will be created.
template
- the template used for building the instrument for the noderateId
- the identifier of the market rate used when building the instrument for the nodepublic static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId, double additionalSpread)
A suitable default label will be created.
template
- the template defining the node instrumentrateId
- the identifier of the market data providing the rate for the node instrumentadditionalSpread
- the additional spread amount added to the ratepublic static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId, double additionalSpread, String label)
template
- the template defining the node instrumentrateId
- the identifier of the market data providing the rate for the node instrumentadditionalSpread
- the additional spread amount added to the ratelabel
- the label to use for the nodepublic Set<ObservableId> requirements()
CurveNode
This returns the market data needed to build the trade that the node represents.
requirements
in interface CurveNode
public LocalDate date(LocalDate valuationDate, ReferenceData refData)
CurveNode
Each curve node has an associated date which defines the x-value in the curve. This date is visible in the parameter metadata.
public DatedParameterMetadata metadata(LocalDate valuationDate, ReferenceData refData)
CurveNode
This provides curve metadata for the node at the specified valuation date.
public SwapTrade trade(double quantity, MarketData marketData, ReferenceData refData)
CurveNode
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.
trade
in interface CurveNode
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 datespublic ResolvedSwapTrade resolvedTrade(double quantity, MarketData marketData, ReferenceData refData)
CurveNode
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.
resolvedTrade
in interface CurveNode
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 tradepublic ResolvedSwapTrade sampleResolvedTrade(LocalDate valuationDate, FxRateProvider fxProvider, ReferenceData refData)
CurveNode
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.
sampleResolvedTrade
in interface CurveNode
valuationDate
- the valuation datefxProvider
- the FX rate providerrefData
- the reference data, used to resolve the tradepublic double initialGuess(MarketData marketData, ValueType valueType)
CurveNode
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.
initialGuess
in interface CurveNode
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 containpublic FixedInflationSwapCurveNode withDate(CurveNodeDate date)
date
- the date to usepublic static FixedInflationSwapCurveNode.Meta meta()
FixedInflationSwapCurveNode
.public static FixedInflationSwapCurveNode.Builder builder()
public FixedInflationSwapCurveNode.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public FixedInflationSwapTemplate getTemplate()
public ObservableId getRateId()
public double getAdditionalSpread()
public String getLabel()
When building, this will default based on the tenor if not specified.
public CurveNodeDate getDate()
public CurveNodeDateOrder getDateOrder()
CurveNodeDateOrder.DEFAULT
.getDateOrder
in interface CurveNode
public FixedInflationSwapCurveNode.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.