Class DiscountingCapitalIndexedBondProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingCapitalIndexedBondProductPricer
-
public class DiscountingCapitalIndexedBondProductPricer extends Object
Pricer for capital indexed bond products.This function provides the ability to price a
ResolvedCapitalIndexedBond
.Price
Strata uses decimal prices for bonds in the trade model, pricers and market data. For example, a price of 99.32% is represented in Strata by 0.9932.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingCapitalIndexedBondProductPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingCapitalIndexedBondProductPricer(DiscountingCapitalIndexedBondPaymentPeriodPricer periodPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
cleanNominalPriceFromDirtyNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double dirtyPrice)
Calculates the clean nominal price of the bond from its settlement date and dirty nominal price.double
cleanPriceFromRealYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the clean price from the conventional real yield.double
cleanRealPriceFromDirtyRealPrice(ResolvedCapitalIndexedBond bond, LocalDate settlementDate, double dirtyPrice)
Calculates the clean real price of the bond from its settlement date and dirty real price.double
convexityFromRealYieldFiniteDifference(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Calculates the convexity from the conventional real yield using finite difference approximation.double
convexityFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the covexity from the standard yield.MultiCurrencyAmount
currencyExposure(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, LocalDate referenceDate)
Calculates the currency exposure of the bond product.MultiCurrencyAmount
currencyExposureWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, LocalDate referenceDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond product with z-spread.CurrencyAmount
currentCash(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate)
Calculates the current cash of the bond product.double
dirtyNominalPriceFromCleanNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double cleanPrice)
Calculates the dirty nominal price of the bond from its settlement date and clean nominal price.double
dirtyNominalPriceFromCurves(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Calculates the dirty price of the bond security.double
dirtyNominalPriceFromCurvesWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the dirty price of the bond security with z-spread.PointSensitivityBuilder
dirtyNominalPriceSensitivity(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Calculates the dirty price sensitivity of the bond security.PointSensitivityBuilder
dirtyNominalPriceSensitivityWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the dirty price sensitivity of the bond security with z-spread.double
dirtyPriceFromRealYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the dirty price from the conventional real yield.double
dirtyPriceFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the dirty price from the standard yield.double
dirtyRealPriceFromCleanRealPrice(ResolvedCapitalIndexedBond bond, LocalDate settlementDate, double cleanPrice)
Calculates the dirty real price of the bond from its settlement date and clean real price.DiscountingCapitalIndexedBondPaymentPeriodPricer
getPeriodPricer()
Obtains the period pricer.double
modifiedDurationFromRealYieldFiniteDifference(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Calculates the modified duration from the conventional real yield using finite difference approximation.double
modifiedDurationFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the modified duration from the standard yield.double
nominalPriceFromRealPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double realPrice)
Calculates the nominal price of the bond from its settlement date and real price.CurrencyAmount
presentValue(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value of the bond.PointSensitivityBuilder
presentValueSensitivity(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value sensitivity of the bond product.PointSensitivityBuilder
presentValueSensitivityWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bond product with z-spread.CurrencyAmount
presentValueWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the bond product with z-spread.double
realPriceFromNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double nominalPrice)
Calculates the real price of the bond from its settlement date and nominal price.double
realYieldFromCurves(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Computes the conventional real yield from the curves.double
realYieldFromDirtyPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double dirtyPrice)
Computes the conventional real yield from the dirty price.double
zSpreadFromCurvesAndCleanPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanPrice, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the z-spread of the bond from curves and clean price.double
zSpreadFromCurvesAndPv(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, CurrencyAmount presentValue, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the z-spread of the bond from curves and present value.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingCapitalIndexedBondProductPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingCapitalIndexedBondProductPricer
public DiscountingCapitalIndexedBondProductPricer(DiscountingCapitalIndexedBondPaymentPeriodPricer periodPricer)
Creates an instance.- Parameters:
periodPricer
- the pricer forCapitalIndexedBondPaymentPeriod
.
-
-
Method Detail
-
getPeriodPricer
public DiscountingCapitalIndexedBondPaymentPeriodPricer getPeriodPricer()
Obtains the period pricer.- Returns:
- the period pricer
-
presentValue
public CurrencyAmount presentValue(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value of the bond.The present value of the product is the value on the valuation date. The result is expressed using the payment currency of the bond.
Coupon payments of the product are considered based on the valuation date.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors provider- Returns:
- the present value of the product
-
presentValueWithZSpread
public CurrencyAmount presentValueWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the bond product with z-spread.The present value of the product is the value on the valuation date. The result is expressed using the payment currency of the bond.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value of the bond product
-
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value sensitivity of the bond product.The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors provider- Returns:
- the present value curve sensitivity of the product
-
presentValueSensitivityWithZSpread
public PointSensitivityBuilder presentValueSensitivityWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bond product with z-spread.The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value curve sensitivity of the product
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, LocalDate referenceDate)
Calculates the currency exposure of the bond product.- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerreferenceDate
- the reference date- Returns:
- the currency exposure of the product
-
currencyExposureWithZSpread
public MultiCurrencyAmount currencyExposureWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, LocalDate referenceDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond product with z-spread.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerreferenceDate
- the reference datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the currency exposure of the product
-
currentCash
public CurrencyAmount currentCash(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate)
Calculates the current cash of the bond product.- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement date- Returns:
- the current cash of the product
-
dirtyNominalPriceFromCurves
public double dirtyNominalPriceFromCurves(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Calculates the dirty price of the bond security.The bond is represented as
Security
where standard ID of the bond is stored.Strata uses decimal prices for bonds. For example, a price of 99.32% is represented in Strata by 0.9932.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement date- Returns:
- the dirty price of the bond security
-
dirtyNominalPriceFromCurvesWithZSpread
public double dirtyNominalPriceFromCurvesWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the dirty price of the bond security with z-spread.The bond is represented as
Security
where standard ID of the bond is stored.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the dirty price of the bond security
-
dirtyNominalPriceSensitivity
public PointSensitivityBuilder dirtyNominalPriceSensitivity(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Calculates the dirty price sensitivity of the bond security.The dirty price sensitivity of the security is the sensitivity of the dirty price value to the underlying curves.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement date- Returns:
- the dirty price curve sensitivity of the security
-
dirtyNominalPriceSensitivityWithZSpread
public PointSensitivityBuilder dirtyNominalPriceSensitivityWithZSpread(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the dirty price sensitivity of the bond security with z-spread.The dirty price sensitivity of the security is the sensitivity of the dirty price value to the underlying curves.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the dirty price curve sensitivity of the security
-
dirtyPriceFromRealYield
public double dirtyPriceFromRealYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the dirty price from the conventional real yield.The resulting dirty price is real price or nominal price depending on the yield convention.
The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the yield- Returns:
- the dirty price of the product
-
cleanPriceFromRealYield
public double cleanPriceFromRealYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the clean price from the conventional real yield.The resulting clean price is real price or nominal price depending on the yield convention.
The input yield and output are expressed in fraction.
Strata uses decimal prices for bonds. For example, a price of 99.32% is represented in Strata by 0.9932.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the yield- Returns:
- the clean price of the product
-
realYieldFromDirtyPrice
public double realYieldFromDirtyPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double dirtyPrice)
Computes the conventional real yield from the dirty price.The input dirty price should be real price or nominal price depending on the yield convention. This is coherent to the implementation of
dirtyPriceFromRealYield(ResolvedCapitalIndexedBond, RatesProvider, LocalDate, double)
.The input price and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement datedirtyPrice
- the bond dirty price- Returns:
- the yield of the product
-
realYieldFromCurves
public double realYieldFromCurves(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData)
Computes the conventional real yield from the curves.The yield is in the bill yield convention.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement date- Returns:
- the yield of the product
-
dirtyPriceFromStandardYield
public double dirtyPriceFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the dirty price from the standard yield.The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the standard yield- Returns:
- the dirty price of the product
-
modifiedDurationFromRealYieldFiniteDifference
public double modifiedDurationFromRealYieldFiniteDifference(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Calculates the modified duration from the conventional real yield using finite difference approximation.The modified duration is defined as the minus of the first derivative of clean price with respect to yield, divided by the clean price.
The clean price here is real price or nominal price depending on the yield convention. This is coherent to the implementation of
dirtyPriceFromRealYield(ResolvedCapitalIndexedBond, RatesProvider, LocalDate, double)
.The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the yield- Returns:
- the modified duration of the product
-
convexityFromRealYieldFiniteDifference
public double convexityFromRealYieldFiniteDifference(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Calculates the convexity from the conventional real yield using finite difference approximation.The convexity is defined as the second derivative of clean price with respect to yield, divided by the clean price.
The clean price here is real price or nominal price depending on the yield convention. This is coherent to the implementation of
dirtyPriceFromRealYield(ResolvedCapitalIndexedBond, RatesProvider, LocalDate, double)
.The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the yield- Returns:
- the covexity of the product
-
modifiedDurationFromStandardYield
public double modifiedDurationFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the modified duration from the standard yield.The modified duration is defined as the minus of the first derivative of dirty price with respect to yield, divided by the dirty price.
The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the standard yield- Returns:
- the modified duration of the product
-
convexityFromStandardYield
public double convexityFromStandardYield(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double yield)
Computes the covexity from the standard yield.The convexity is defined as the second derivative of dirty price with respect to yield, divided by the dirty price.
The input yield and output are expressed in fraction.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement dateyield
- the standard yield- Returns:
- the convexity of the product
-
dirtyRealPriceFromCleanRealPrice
public double dirtyRealPriceFromCleanRealPrice(ResolvedCapitalIndexedBond bond, LocalDate settlementDate, double cleanPrice)
Calculates the dirty real price of the bond from its settlement date and clean real price.- Parameters:
bond
- the productsettlementDate
- the settlement datecleanPrice
- the clean real price- Returns:
- the price of the bond product
-
cleanRealPriceFromDirtyRealPrice
public double cleanRealPriceFromDirtyRealPrice(ResolvedCapitalIndexedBond bond, LocalDate settlementDate, double dirtyPrice)
Calculates the clean real price of the bond from its settlement date and dirty real price.- Parameters:
bond
- the productsettlementDate
- the settlement datedirtyPrice
- the dirty real price- Returns:
- the price of the bond product
-
dirtyNominalPriceFromCleanNominalPrice
public double dirtyNominalPriceFromCleanNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double cleanPrice)
Calculates the dirty nominal price of the bond from its settlement date and clean nominal price.- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement datecleanPrice
- the clean nominal price- Returns:
- the price of the bond product
-
cleanNominalPriceFromDirtyNominalPrice
public double cleanNominalPriceFromDirtyNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double dirtyPrice)
Calculates the clean nominal price of the bond from its settlement date and dirty nominal price.- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement datedirtyPrice
- the dirty nominal price- Returns:
- the price of the bond product
-
realPriceFromNominalPrice
public double realPriceFromNominalPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double nominalPrice)
Calculates the real price of the bond from its settlement date and nominal price.The input and output prices are both clean or dirty.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement datenominalPrice
- the nominal price- Returns:
- the price of the bond product
-
nominalPriceFromRealPrice
public double nominalPriceFromRealPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LocalDate settlementDate, double realPrice)
Calculates the nominal price of the bond from its settlement date and real price.The input and output prices are both clean or dirty.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuessettlementDate
- the settlement daterealPrice
- the real price- Returns:
- the price of the bond product
-
zSpreadFromCurvesAndCleanPrice
public double zSpreadFromCurvesAndCleanPrice(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanPrice, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the z-spread of the bond from curves and clean price.The input clean price is real price or nominal price depending on the yield convention.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve associated to the bond (Issuer Entity) to match the present value.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datecleanPrice
- the clean pricecompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the z-spread of the bond security
-
zSpreadFromCurvesAndPv
public double zSpreadFromCurvesAndPv(ResolvedCapitalIndexedBond bond, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, CurrencyAmount presentValue, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the z-spread of the bond from curves and present value.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve associated to the bond (Issuer Entity) to match the present value.
- Parameters:
bond
- the productratesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datepresentValue
- the present valuecompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the z-spread of the bond product
-
-