Class DiscountingKnownAmountPaymentPeriodPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.swap.DiscountingKnownAmountPaymentPeriodPricer
-
- All Implemented Interfaces:
SwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
public class DiscountingKnownAmountPaymentPeriodPricer extends Object implements SwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
Pricer implementation for swap payment periods based on a known amount.This pricer performs discounting of the known amount.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingKnownAmountPaymentPeriodPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingKnownAmountPaymentPeriodPricer(DiscountingPaymentPricer paymentPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
accruedInterest(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the accrued interest since the last payment.MultiCurrencyAmount
currencyExposure(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the currency exposure of a single payment period.double
currentCash(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the current cash of a single payment period.void
explainPresentValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider, ExplainMapBuilder builder)
Explains the present value of a single payment period.double
forecastValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the forecast value of a single payment period.PointSensitivityBuilder
forecastValueSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the forecast value sensitivity of a single payment period.double
presentValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the present value of a single payment period.PointSensitivityBuilder
presentValueSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the present value sensitivity of a single payment period.double
pvbp(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the present value of a basis point of a period.PointSensitivityBuilder
pvbpSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Calculates the present value of a basis point sensitivity of a single payment period.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingKnownAmountPaymentPeriodPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingKnownAmountPaymentPeriodPricer
public DiscountingKnownAmountPaymentPeriodPricer(DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
paymentPricer
- the payment pricer
-
-
Method Detail
-
presentValue
public double presentValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the present value of a single payment period.The amount is expressed in the currency of the period. This returns the value of the period with discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Specified by:
presentValue
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the present value of the period
-
forecastValue
public double forecastValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the forecast value of a single payment period.The amount is expressed in the currency of the period. This returns the value of the period without discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Specified by:
forecastValue
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the forecast value of the period
-
accruedInterest
public double accruedInterest(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the accrued interest since the last payment.This calculates the interest that has accrued between the start of the period and the valuation date. Discounting is not applied. The amount is expressed in the currency of the period. It is intended that this method is called only with the period where the valuation date is after the start date and before or equal to the end date.
- Specified by:
accruedInterest
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the accrued interest of the period
-
pvbp
public double pvbp(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the present value of a basis point of a period.This calculate the amount by which, to the first order, the period present value changes for a change of the rate defining the payment period. For known amount payments for which there is rate, the value is 0. In absence of compounding on the period, this measure is equivalent to the traditional PVBP.
- Specified by:
pvbp
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the present value of a basis point
-
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the present value sensitivity of a single payment period.The present value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Specified by:
presentValueSensitivity
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the present value curve sensitivity of the period
-
forecastValueSensitivity
public PointSensitivityBuilder forecastValueSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the forecast value sensitivity of a single payment period.The forecast value sensitivity of the period is the sensitivity of the forecast value to the underlying curves.
- Specified by:
forecastValueSensitivity
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the forecast value curve sensitivity of the period
-
pvbpSensitivity
public PointSensitivityBuilder pvbpSensitivity(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the present value of a basis point sensitivity of a single payment period.This calculate the sensitivity of the present value of a basis point (pvbp) quantity to the underlying curves.
- Specified by:
pvbpSensitivity
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the present value of a basis point sensitivity
-
explainPresentValue
public void explainPresentValue(KnownAmountSwapPaymentPeriod period, RatesProvider provider, ExplainMapBuilder builder)
Description copied from interface:SwapPaymentPeriodPricer
Explains the present value of a single payment period.This adds information to the
ExplainMapBuilder
to aid understanding of the calculation.- Specified by:
explainPresentValue
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates providerbuilder
- the builder to populate
-
currencyExposure
public MultiCurrencyAmount currencyExposure(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the currency exposure of a single payment period.- Specified by:
currencyExposure
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the currency exposure
-
currentCash
public double currentCash(KnownAmountSwapPaymentPeriod period, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricer
Calculates the current cash of a single payment period.- Specified by:
currentCash
in interfaceSwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod>
- Parameters:
period
- the periodprovider
- the rates provider- Returns:
- the current cash
-
-