public class DiscountingFixedCouponBondProductPricer extends Object
This function provides the ability to price a ResolvedFixedCouponBond.
| Modifier and Type | Field and Description |
|---|---|
static DiscountingFixedCouponBondProductPricer |
DEFAULT
Default implementation.
|
| Constructor and Description |
|---|
DiscountingFixedCouponBondProductPricer(DiscountingFixedCouponBondPaymentPeriodPricer periodPricer,
DiscountingPaymentPricer nominalPricer)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
double |
accruedInterest(ResolvedFixedCouponBond bond,
LocalDate settlementDate)
Calculates the accrued interest of the fixed coupon bond with the specified settlement date.
|
double |
accruedYearFraction(ResolvedFixedCouponBond bond,
LocalDate settlementDate)
Calculates the accrued year fraction of the fixed coupon bond with the specified settlement date.
|
double |
cleanPriceFromDirtyPrice(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double dirtyPrice)
Calculates the clean price of the fixed coupon bond from its settlement date and dirty price.
|
double |
convexityFromYield(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the convexity of the fixed coupon bond product from yield.
|
double |
dirtyPriceFromCleanPrice(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double cleanPrice)
Calculates the dirty price of the fixed coupon bond from its settlement date and clean price.
|
double |
dirtyPriceFromCurves(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
LocalDate settlementDate)
Calculates the dirty price of the fixed coupon bond under the specified settlement date.
|
double |
dirtyPriceFromCurves(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
ReferenceData refData)
Calculates the dirty price of the fixed coupon bond.
|
double |
dirtyPriceFromCurvesWithZSpread(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear,
LocalDate settlementDate)
Calculates the dirty price of the fixed coupon bond under the specified settlement date with z-spread.
|
double |
dirtyPriceFromCurvesWithZSpread(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
ReferenceData refData,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the dirty price of the fixed coupon bond with z-spread.
|
double |
dirtyPriceFromYield(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the dirty price of the fixed coupon bond from yield.
|
ValueDerivatives |
dirtyPriceFromYieldAd(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the dirty price of the fixed coupon bond from yield and its derivative wrt to the yield.
|
PointSensitivityBuilder |
dirtyPriceSensitivity(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
LocalDate settlementDate)
Calculates the dirty price sensitivity of the fixed coupon bond product under the specified settlement date.
|
PointSensitivityBuilder |
dirtyPriceSensitivity(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
ReferenceData refData)
Calculates the dirty price sensitivity of the fixed coupon bond product.
|
PointSensitivityBuilder |
dirtyPriceSensitivityWithZspread(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
ReferenceData refData,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the dirty price sensitivity of the fixed coupon bond with z-spread.
|
double |
macaulayDurationFromYield(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the Macaulay duration of the fixed coupon bond product from yield.
|
double |
modifiedDurationFromYield(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the modified duration of the fixed coupon bond product from yield.
|
ValueDerivatives |
modifiedDurationFromYieldAd(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double yield)
Calculates the modified duration of the fixed coupon bond product from yield and its derivative wrt to the yield.
|
CurrencyAmount |
presentValue(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider)
Calculates the present value of the fixed coupon bond product.
|
PointSensitivityBuilder |
presentValueSensitivity(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of the fixed coupon bond product.
|
PointSensitivityBuilder |
presentValueSensitivityWithZSpread(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the present value sensitivity of the fixed coupon bond with z-spread.
|
CurrencyAmount |
presentValueWithZSpread(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
double zSpread,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the present value of the fixed coupon bond product with z-spread.
|
double |
yieldFromDirtyPrice(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double dirtyPrice)
Calculates the yield of the fixed coupon bond product from dirty price.
|
ValueDerivatives |
yieldFromDirtyPriceAd(ResolvedFixedCouponBond bond,
LocalDate settlementDate,
double dirtyPrice)
Calculates the yield of the fixed coupon bond product from dirty price and its derivative wrt the price.
|
double |
zSpreadFromCurvesAndDirtyPrice(ResolvedFixedCouponBond bond,
LegalEntityDiscountingProvider provider,
ReferenceData refData,
double dirtyPrice,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the z-spread of the fixed coupon bond from curves and dirty price.
|
public static final DiscountingFixedCouponBondProductPricer DEFAULT
public DiscountingFixedCouponBondProductPricer(DiscountingFixedCouponBondPaymentPeriodPricer periodPricer, DiscountingPaymentPricer nominalPricer)
periodPricer - the pricer for FixedCouponBondPaymentPeriodnominalPricer - the pricer for Paymentpublic CurrencyAmount presentValue(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider)
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.
bond - the productprovider - the discounting providerpublic CurrencyAmount presentValueWithZSpread(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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.
bond - the productprovider - the discounting providerzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearpublic double dirtyPriceFromCurves(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, ReferenceData refData)
The fixed coupon 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.
bond - the productprovider - the discounting providerrefData - the reference data used to calculate the settlement datepublic double dirtyPriceFromCurves(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
The fixed coupon bond is represented as Security where standard ID of the bond is stored.
bond - the productprovider - the discounting providersettlementDate - the settlement datepublic double dirtyPriceFromCurvesWithZSpread(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
The fixed coupon bond is represented as Security where standard ID of the bond is stored.
bond - the productprovider - the discounting providerrefData - the reference data used to calculate the settlement datezSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearpublic double dirtyPriceFromCurvesWithZSpread(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear, LocalDate settlementDate)
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
The fixed coupon bond is represented as Security where standard ID of the bond is stored.
bond - the productprovider - the discounting providerzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearsettlementDate - the settlement datepublic double dirtyPriceFromCleanPrice(ResolvedFixedCouponBond bond, LocalDate settlementDate, double cleanPrice)
bond - the productsettlementDate - the settlement datecleanPrice - the clean pricepublic double cleanPriceFromDirtyPrice(ResolvedFixedCouponBond bond, LocalDate settlementDate, double dirtyPrice)
Strata uses decimal prices for bonds. For example, a price of 99.32% is represented in Strata by 0.9932.
bond - the productsettlementDate - the settlement datedirtyPrice - the dirty pricepublic double zSpreadFromCurvesAndDirtyPrice(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, ReferenceData refData, double dirtyPrice, CompoundedRateType compoundedRateType, int periodsPerYear)
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 dirty price.
bond - the productprovider - the discounting providerrefData - the reference data used to calculate the settlement datedirtyPrice - the dirtyPricecompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearpublic PointSensitivityBuilder presentValueSensitivity(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider)
The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.
bond - the productprovider - the discounting providerpublic PointSensitivityBuilder presentValueSensitivityWithZSpread(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
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.
bond - the productprovider - the discounting providerzSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearpublic PointSensitivityBuilder dirtyPriceSensitivity(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, ReferenceData refData)
The dirty price sensitivity of the security is the sensitivity of the present value to the underlying curves.
bond - the productprovider - the discounting providerrefData - the reference data used to calculate the settlement datepublic PointSensitivityBuilder dirtyPriceSensitivity(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
The dirty price sensitivity of the security is the sensitivity of the present value to the underlying curves.
bond - the productprovider - the discounting providersettlementDate - the settlement datepublic PointSensitivityBuilder dirtyPriceSensitivityWithZspread(ResolvedFixedCouponBond bond, LegalEntityDiscountingProvider provider, ReferenceData refData, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
The dirty price sensitivity of the security 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 discounting curve.
bond - the productprovider - the discounting providerrefData - the reference data used to calculate the settlement datezSpread - the z-spreadcompoundedRateType - the compounded rate typeperiodsPerYear - the number of periods per yearpublic double accruedInterest(ResolvedFixedCouponBond bond, LocalDate settlementDate)
bond - the productsettlementDate - the settlement datepublic double accruedYearFraction(ResolvedFixedCouponBond bond, LocalDate settlementDate)
bond - the productsettlementDate - the settlement datepublic double dirtyPriceFromYield(ResolvedFixedCouponBond bond, LocalDate settlementDate, double yield)
The yield must be fractional.
The dirty price is computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldpublic ValueDerivatives dirtyPriceFromYieldAd(ResolvedFixedCouponBond bond, LocalDate settlementDate, double yield)
The yield must be fractional.
The dirty price is computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldpublic double yieldFromDirtyPrice(ResolvedFixedCouponBond bond, LocalDate settlementDate, double dirtyPrice)
The dirty price must be fractional.
If the analytic formula is not available, the yield is computed by solving
a root-finding problem with dirtyPriceFromYield(ResolvedFixedCouponBond, LocalDate, double).
The result is also expressed in fraction.
bond - the productsettlementDate - the settlement datedirtyPrice - the dirty pricepublic ValueDerivatives yieldFromDirtyPriceAd(ResolvedFixedCouponBond bond, LocalDate settlementDate, double dirtyPrice)
The dirty price must be fractional.
If the analytic formula is not available, the yield is computed by solving
a root-finding problem with dirtyPriceFromYield(ResolvedFixedCouponBond, LocalDate, double).
The result is also expressed in fraction.
bond - the productsettlementDate - the settlement datedirtyPrice - the dirty pricepublic double modifiedDurationFromYield(ResolvedFixedCouponBond bond, LocalDate settlementDate, double 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 must be fractional. The dirty price and its derivative are
computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldpublic ValueDerivatives modifiedDurationFromYieldAd(ResolvedFixedCouponBond bond, LocalDate settlementDate, double 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 must be fractional. The dirty price and its derivative are
computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldpublic double macaulayDurationFromYield(ResolvedFixedCouponBond bond, LocalDate settlementDate, double yield)
Macaulay defined an alternative way of weighting the future cash flows.
The input yield must be fractional. The dirty price and its derivative are
computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldpublic double convexityFromYield(ResolvedFixedCouponBond bond, LocalDate settlementDate, double yield)
The convexity is defined as the second derivative of dirty price with respect to yield, divided by the dirty price.
The input yield must be fractional. The dirty price and its derivative are
computed for FixedCouponBondYieldConvention, and the result is expressed in fraction.
bond - the productsettlementDate - the settlement dateyield - the yieldCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.