Class DiscountingBillTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingBillTradePricer
-
public class DiscountingBillTradePricer extends Object
Pricer for bill trades.This function provides the ability to price a
ResolvedBillTrade.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingBillTradePricerDEFAULTDefault implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingBillTradePricer(DiscountingBillProductPricer productPricer, DiscountingPaymentPricer paymentPricer)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmountcurrencyExposure(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)Calculates the currency exposure of a bill trade.MultiCurrencyAmountcurrencyExposureWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Calculates the currency exposure of a bill trade with z-spread.CurrencyAmountcurrentCash(ResolvedBillTrade trade, LocalDate valuationDate)Calculates the current cash of a bill trade.CurrencyAmountpresentValue(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)Calculates the present value of a bill trade.PointSensitivitiespresentValueSensitivity(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)Calculates the present value sensitivity of a bill trade.PointSensitivitiespresentValueSensitivityWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Calculates the present value sensitivity of a bill trade with z-spread.CurrencyAmountpresentValueWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Calculates the present value of a bill trade with z-spread.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingBillTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingBillTradePricer
public DiscountingBillTradePricer(DiscountingBillProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
productPricer- the pricer forResolvedBillpaymentPricer- the pricer forPayment
-
-
Method Detail
-
presentValue
public CurrencyAmount presentValue(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value of a bill trade.If the settlement details are provided, the present value is the sum of the underlying product's present value multiplied by the quantity and the present value of the settlement payment if still due at the valuation date. If not it is the underlying product's present value multiplied by the quantity.
- Parameters:
trade- the tradeprovider- the discounting provider- Returns:
- the present value
-
presentValueWithZSpread
public CurrencyAmount presentValueWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a bill trade with z-spread.If the settlement details are provided, the present value is the sum of the underlying product's present value multiplied by the quantity and the present value of the settlement payment if still due at the valuation date. If not it is the underlying product's present value multiplied by the quantity.
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 used for the settlement amount.
- Parameters:
trade- the tradeprovider- the discounting providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per year- Returns:
- the present value
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of a bill trade.If the settlement details are provided, the sensitivity is the sum of the underlying product's sensitivity multiplied by the quantity and the sensitivity of the settlement payment if still due at the valuation date. If not it is the underlying product's sensitivity multiplied by the quantity.
- Parameters:
trade- the tradeprovider- the discounting provider- Returns:
- the present value sensitivity
-
presentValueSensitivityWithZSpread
public PointSensitivities presentValueSensitivityWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of a bill trade with z-spread.If the settlement details are provided, the sensitivity is the sum of the underlying product's sensitivity multiplied by the quantity and the sensitivity of the settlement payment if still due at the valuation date. If not it is the underlying product's sensitivity multiplied by the quantity.
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 used for the settlement amount.
- Parameters:
trade- the tradeprovider- the discounting providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per year- Returns:
- the present value sensitivity
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the currency exposure of a bill trade.- Parameters:
trade- the tradeprovider- the discounting provider- Returns:
- the currency exposure
-
currencyExposureWithZSpread
public MultiCurrencyAmount currencyExposureWithZSpread(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of a bill trade with z-spread.- Parameters:
trade- the tradeprovider- the discounting providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per year- Returns:
- the currency exposure
-
currentCash
public CurrencyAmount currentCash(ResolvedBillTrade trade, LocalDate valuationDate)
Calculates the current cash of a bill trade.- Parameters:
trade- the tradevaluationDate- the valuation date- Returns:
- the current cash amount
-
-