Class CdsIsdaCreditCurveNode
- java.lang.Object
-
- com.opengamma.strata.market.curve.node.CdsIsdaCreditCurveNode
-
- All Implemented Interfaces:
IsdaCreditCurveNode,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class CdsIsdaCreditCurveNode extends Object implements IsdaCreditCurveNode, org.joda.beans.ImmutableBean, Serializable
An ISDA compliant curve node whose instrument is a credit default swap.The trade produced by the node will be a protection receiver (BUY) for a positive quantity and a protection payer (SELL) for a negative quantity.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCdsIsdaCreditCurveNode.BuilderThe bean-builder forCdsIsdaCreditCurveNode.static classCdsIsdaCreditCurveNode.MetaThe meta-bean forCdsIsdaCreditCurveNode.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CdsIsdaCreditCurveNode.Builderbuilder()Returns a builder used to create an instance of the bean.LocalDatedate(LocalDate tradeDate, ReferenceData refData)Calculates the date associated with the node.booleanequals(Object obj)OptionalDoublegetFixedRate()Gets the fixed coupon rate.StringgetLabel()Gets the label to use for the node.StandardIdgetLegalEntityId()Gets the legal entity identifier.ObservableIdgetObservableId()Gets the identifier of the market data value that provides the quoted value.CdsQuoteConventiongetQuoteConvention()Gets the market quote convention.CdsTemplategetTemplate()Gets the template for the CDS associated with this node.inthashCode()static CdsIsdaCreditCurveNode.Metameta()The meta-bean forCdsIsdaCreditCurveNode.CdsIsdaCreditCurveNode.MetametaBean()DatedParameterMetadatametadata(LocalDate nodeDate)Returns metadata for the node from the node date.static CdsIsdaCreditCurveNodeofParSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId)Returns a curve node with par spread convention.static CdsIsdaCreditCurveNodeofPointsUpfront(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)Returns a curve node with points upfront convention.static CdsIsdaCreditCurveNodeofQuotedSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)Returns a curve node with quoted spread convention.CdsIsdaCreditCurveNode.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()CdsCalibrationTradetrade(double quantity, MarketData marketData, ReferenceData refData)Creates a trade representing the CDS at the node.
-
-
-
Method Detail
-
ofParSpread
public static CdsIsdaCreditCurveNode ofParSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId)
Returns a curve node with par spread convention.- Parameters:
template- the templateobservableId- the observable IDlegalEntityId- the legal entity ID- Returns:
- the curve node
-
ofPointsUpfront
public static CdsIsdaCreditCurveNode ofPointsUpfront(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with points upfront convention.- Parameters:
template- the templateobservableId- the observable IDlegalEntityId- the legal entity IDfixedRate- the fixed rate- Returns:
- the curve node
-
ofQuotedSpread
public static CdsIsdaCreditCurveNode ofQuotedSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with quoted spread convention.- Parameters:
template- the templateobservableId- the observable IDlegalEntityId- the legal entity IDfixedRate- the fixed rate- Returns:
- the curve node
-
date
public LocalDate date(LocalDate tradeDate, ReferenceData refData)
Description copied from interface:IsdaCreditCurveNodeCalculates the date associated with the node.Each curve node has an associated date which defines the x-value in the curve. This is typically the adjusted end date of the instrument.
- Specified by:
datein interfaceIsdaCreditCurveNode- Parameters:
tradeDate- the trade daterefData- the reference data- Returns:
- the node date
-
metadata
public DatedParameterMetadata metadata(LocalDate nodeDate)
Description copied from interface:IsdaCreditCurveNodeReturns metadata for the node from the node date.The node date must be computed by
IsdaCreditCurveNode.date(LocalDate, ReferenceData).- Specified by:
metadatain interfaceIsdaCreditCurveNode- Parameters:
nodeDate- the node date used when calibrating the curve- Returns:
- metadata for the node
-
trade
public CdsCalibrationTrade trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the CDS at the node.This uses the observed market data to build the CDS trade that the node represents. 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.
- 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
-
meta
public static CdsIsdaCreditCurveNode.Meta meta()
The meta-bean forCdsIsdaCreditCurveNode.- Returns:
- the meta-bean, not null
-
builder
public static CdsIsdaCreditCurveNode.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public CdsIsdaCreditCurveNode.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getTemplate
public CdsTemplate getTemplate()
Gets the template for the CDS associated with this node.- Returns:
- the value of the property, not null
-
getLabel
public String getLabel()
Gets the label to use for the node.When building, this will default based on
templateif not specified.- Specified by:
getLabelin interfaceIsdaCreditCurveNode- Returns:
- the value of the property, not empty
-
getObservableId
public ObservableId getObservableId()
Gets the identifier of the market data value that provides the quoted value.- Specified by:
getObservableIdin interfaceIsdaCreditCurveNode- Returns:
- the value of the property, not null
-
getLegalEntityId
public StandardId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the reference legal entity of the CDS.
- Returns:
- the value of the property, not null
-
getQuoteConvention
public CdsQuoteConvention getQuoteConvention()
Gets the market quote convention.The CDS is quoted in par spread, points upfront or quoted spread. See
CdsQuoteConventionfor detail.- Returns:
- the value of the property, not null
-
getFixedRate
public OptionalDouble getFixedRate()
Gets the fixed coupon rate.This must be represented in decimal form.
- Returns:
- the optional value of the property, not null
-
toBuilder
public CdsIsdaCreditCurveNode.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-