Class DiscountingBillProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingBillProductPricer
-
public class DiscountingBillProductPricer extends Object
Pricer for bill products.This function provides the ability to price a
ResolvedBill
.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingBillProductPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingBillProductPricer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrencyAmount
presentValue(ResolvedBill bill, LegalEntityDiscountingProvider provider)
Calculates the present value of the bill product.PointSensitivities
presentValueSensitivity(ResolvedBill bill, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of the bill product.PointSensitivities
presentValueSensitivityWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bill product with z-spread.CurrencyAmount
presentValueWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a bill product with z-spread.double
priceFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
Calculates the price for settlement at a given settlement date using curves.double
priceFromCurvesWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the price for settlement at a given settlement date using curves with z-spread.double
yieldFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
Calculates the yield for settlement at a given settlement date using curves.double
yieldFromCurvesWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the yield for settlement at a given settlement date using curves with z-spread.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingBillProductPricer DEFAULT
Default implementation.
-
-
Method Detail
-
presentValue
public CurrencyAmount presentValue(ResolvedBill bill, LegalEntityDiscountingProvider provider)
Calculates the present value of the bill product.The present value of the product is the value on the valuation date. The result is expressed using the payment currency of the bill.
Coupon payments of the product are considered based on the valuation date.
- Parameters:
bill
- the productprovider
- the discounting provider- Returns:
- the present value of the bill product
-
presentValueWithZSpread
public CurrencyAmount presentValueWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a bill 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:
bill
- the productprovider
- the discounting providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value of the bill product
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedBill bill, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of the bill product.The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.
- Parameters:
bill
- the productprovider
- the discounting provider- Returns:
- the present value curve sensitivity of the product
-
presentValueSensitivityWithZSpread
public PointSensitivities presentValueSensitivityWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bill 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:
bill
- the productprovider
- the discounting providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value curve sensitivity of the product
-
priceFromCurves
public double priceFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
Calculates the price for settlement at a given settlement date using curves.- Parameters:
bill
- the billprovider
- the discounting providersettlementDate
- the settlement date- Returns:
- the price
-
priceFromCurvesWithZSpread
public double priceFromCurvesWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the price for settlement at a given settlement date using curves with z-spread.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.
The z-spread is applied only on the legal entity curve, not on the repo curve.
- Parameters:
bill
- the billprovider
- the discounting providersettlementDate
- the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the price
-
yieldFromCurves
public double yieldFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate)
Calculates the yield for settlement at a given settlement date using curves.- Parameters:
bill
- the billprovider
- the discounting providersettlementDate
- the settlement date- Returns:
- the yield
-
yieldFromCurvesWithZSpread
public double yieldFromCurvesWithZSpread(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the yield for settlement at a given settlement date using curves with z-spread.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.
The z-spread is applied only on the legal entity curve, not on the repo curve.
- Parameters:
bill
- the billprovider
- the discounting providersettlementDate
- the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the yield
-
-